Information about jClouds - jclouds

I have installed jclouds and I am trying to learn how it works internally.
I read all the documentation on the site and on the github but still I have lot of questions about the architecture and implementation of the jClouds.
Do you know where I can find documentation about the deep technical implementation of the framework? I am also looking information on how to add a new provider( for blobstore service)
Currently I am looking into the code but it s not always straightforward what the code does.

The best thing to do is send an email to our dev list. You can subscribe by emailing jclouds-dev-subscribe#apache.org. You can also find us on IRC at #jclouds on freenode.
Adding a new provider is quite an important change for jclouds. The first thing you'll want to do is review How To Contribute. We need to make sure it will work properly and we'll be able to properly test it so don't be discouraged by the reviews.
Having said this, a number of general considerations to take into account when starting a new provider:
New providers are added in labs first, until they are stable.
To follow the jclouds style, use a 3 space indent and a 120 character line length.
We use Guava as our core library. Try to use its utilities before adding new dependencies. In general, do not add dependencies before consulting our dev# list.
We require both live and mock tests. "mock" tests verify that the api generates the expected request according to the method annotations, and that the response is properly parsed. We use MockWebServer to do that, and you can take a look at the MockTests classes in the openstack-swift api to see an example of how these tests work.
Often the best thing to do is to copy the entire directory structure of one of the existing apis or providers and delete everything that you don't need but keep some of the files around in each directory to server as an example of how to do things. You can rename those classes and start your work from there.
Which api or provider should you choose to use as an example for your work? It depends! Please email us on our dev# list to describe the work your doing and we will recommend one. The earlier you get engaged with the jclouds community, the easier the whole process will be.
Good luck!

Related

Need for versioning api

Can somebody please explain me what exactly is API versioning and why is it needed. I know how to create versions for api on a rails web app, but I really want to know why is it needed. Before somebody downvotes or flags or anything, I googled , I couldn't find any satisfying answer. I would really appreciate it if somebody answers this.
API versioning allows you to have multiple versions of your API and use them at the same time. With this solution, you are assuring backward compatibility for all of the applications integrated with your API.
Simple example
Your API is used by 10 different applications. You are using Basic access authentication, but you noticed that it could be done better. So, you decided to use modify this and use Oauth.
No API versioning
You will have to wait for all of 10 applications to implement changes before releasing the new API version. Otherwise, you will lose the integration. Of course, you can use if/else statements in your code to distinguish which authentication method should you use but this will be not elegant.
API versioning
You can release new API version whenever you want. Then, you can inform your client, that the old API will be deprecated in 3 months, so they have time to implement changes on their side.
Also, you can ask them to add a param to all requests (to choose which API version they will use), and you can set it by the default to the new version. That will allow you to avoid problems with new applications that want to use your API.
Summary(in my opinion):
Pros
1. clean and elegant code (without additional if/else statements)
2. backward compatibility
Cons
1. sometimes you have to duplicate your code
2. it might look like a complex solution at the beginning but don't be scared
Here you can read about two options of API versioning - URL param and HTTP header
I hope that my explanation is clear and helps you understand API versioning
The main reason for versioning your APIs is to provide a constant structure for everybody using them. Let's say you define an initial API for your service (v1) that you send out to your clients. After some time your app changes, and you maybe want to exclude some fields/add new ones. This would be a problem for the client, since their implementation of your API might break if some fields that they are expecting is missing. So you create a v2 with those features, without breaking the initial functionality.

Allowing others to copy and tweak my Rails app online

I have developed a relatively simple Rails web application that others (non-programmers) may find useful. I would like to provide a web interface for anyone who wants to create their own copy of my app and change some minor settings, like the appearance, the name of the app and some of its resources, that type of thing. What kind of technology would allow me to do this? Thank you in advance!
GitHub is probably one of the most popular tools to support this, but there are many others such as SourceForge. I'd start from there and do some research to decide the best one for your purposes.
The best way to collaborate code online is through git. The most popular sites for git management include GitHub and BitBucket. Here's a good article suggesting nine alternatives.
However, you stated it would be used by "non-programmers". I can't tell if they will find it useful through the function of the application or the simplicity of the code, so it seems reasonable to also suggest non-git options.
You could use something like Amazon Web Services or Google Cloud to host the static files. See the AWS S3 docs regarding creating a bucket and adding an object.
If you would like to host the entire application online and allow users to easily edit and view the application in-browser, check out cloud9.

Rails app on github – how secure is that?

I'm going to upload the app, I've been working on, on the Github and make it public. The app is a website, which is on Rails. The question is – how secure is that? Isn't making my app's code public increase the chance of breaking in?
Rails' source code is open source / public anyway, so if you're referring to someone finding a "backdoor" or something, surely it would have been done already?
--
Parts Of The Pie
The real question of uploading your code to github is whether your application is secure by doing it. This is more a question of data integrity than source code "secrets", and as #Andrew Marshall mentioned in the comments, will be more dependent on you protecting your API keys & other authentication details, than it will be about minimizing the threat of security compromise.
The other thing to remember is the modularity of Rails,
from a dependency perspective. The real value of an app is its
community - the people who care about uploading new content to it.
This means your database, partner applications, on-site experience & "marketing" are worth far more than your bare source code. Sure, the source is important, but it's just one part of the pie ;)
You'll be much better focusing on your stack (to make it extensible), your application's relevance to your community, and how you're able to extend the functionality with partner services
It all depends on how you secure your website to start. People can see all of your routes, so you need to protect restricted routes with before_action. If you have some kind of backdoor, they can see that too, so don't have one. If you follow good password encryption and login practices, you should be fine. The big file I would leave off Github is config/secrets.yml (as the name implies). But either way, most people aren't going to stumble across or care about reading your code, unless you advertise the link somewhere.

A ticket System to integrate in Rails

I want to add a Ticket System to the web app I'm developing.
The idea is very simple:
Users can open tickets when they have problems and
the Admin can see the tickets the users have submitted.
I'm looking for a ticket system but I have found only systems that are external to the web. I want to add it IN my wep app.
¿Do you know any ticket system por rails?
Thanks
I think using some external gem like noted above would be either an overkill or a hassle due to mentioned bad documentation.
Judging by your problem description this is quite simple to implement.
Create model for tickets and associations with users (I assume you
already have users model fully set up).
Authorize access to tickets' actions depending on user status (admin
or not)
Create corresponding views
P.S.
You could have a look at Redmine code. It is an open source project management software written in rails. I am sure this could give you a good idea of how to build your own or even borrow bits of code from there (if the app license that you are building fits)
Maybe Simple-Ticket would fit you. Though beware the basic implementation and the fact that there is no documentation provided nor written specs.
Have a look at restrospectiva. It doesn't have any documentation though

A pre-built extendable web application for Rails?

I am wondering if there is a standard pre-built web application for Rails which has all the basic functionalities like user login, user profiles, profile image uploader, comments, search, maybe payments and a set of other usual web application features all bundled and ready to use and extend.
I like how Twitter bootstrap comes with a set of pre-built interface functionalities and styles, which you can start using and modify later. I am looking for something similar that can allow me to quickly set up a working application and go from there.
Does such a framework exist?
There are numerous examples out there.
However, there are two things you should really do:
Read the license to make sure you can use it they way you are thinking of using it.
Ensure you understand the design decisions and choices the original authors made. You will end up in a world of maintenance pain if you just copy cargo-cult style without understanding the tradeoffs others have made with their design decisions.
Any one of the links listed has enough to get you started. They may not have all of the features you listed but together they probably have all of your bases covered. You will have to put in some effort to get all those features working together though.
The RailsApps project is great because they all have tutorials that walk through the basic setup. They are also all built using the Rails Composer tool, which lets you pick and choose certain options for your app.

Resources