| layout | title |
|---|---|
docs |
Cloud Model |
Before deploying an application with the Cloudiator framework the first step is the definition of a cloud target.
For this purpose, three entities have to be created:
- An Api, depicting the programming interface the cloud uses, e.g. Nova in case of Openstack.
- A Cloud, depicting the endpoint where the API of the cloud is reachable.
- A CloudCredential, depicting the user credentials for the given cloud endpoint.
In this example we will create the required entities using an Openstack Cloud.
For this purpose, we will need the following information for your Openstack Cloud.
- The endpoint of the Openstack Cloud.
- Your tenant name.
- Your username.
- Your API password.
For other cloud providers, you can have a look at the examples section of Sword. The code examples list the information required for those providers.
You can easily retrieve this information from the Openstack dashboard:
- Login
- Select the correct tenant from the tenant dropdown menu near the Openstack logo in the top-left edge. (If it does not exist, you only have one tenant and you can skip this step)
- Go to the "Compute" tab on the left navigation bar.
- Click Access & Security.
- Click the button "Download Openstack RC File".
- Open the file in the editor: endpoint maps to OS_AUTH_URL, tenant maps to OS_TENANT_NAME, username maps to OS_USERNAME and password is most likely the password you also used for dashboard authentication or OS_PASSWORD.
Finally, you can start creating the entities in Cloudiator. Throughout the example, we will list three possibilities: Using the colosseum-client , direct REST (e.g. by using a client like Insomnia) or the user interface.
Before starting you may want to read the basic guide about API authentication and the guides about the respective components.
String apiName = "openstack-nova";
String internalProviderName = "openstack-nova";
client.controller(Api.class).updateOrCreate(
new ApiBuilder().name(apiName)
.internalProviderName(internalProviderName).build());{
"internalProviderName": "openstack-nova",
"name": "openstack-nova"
}Long apiId = 1;
String endpoint = "https://my-cloud-endpoint.com/example";
String cloudName = "My Openstack";
client.controller(Cloud.class).updateOrCreate(
new CloudBuilder().api(apiId).endpoint(endpoint)
.name(cloudName).build());
__{
"name": "My Openstack",
"endpoint": "https://my-cloud-endpoint.com/example",
"api": 1
}Long cloudId = 1;
String username = "MyCloudUsername";
String secret = "MySecretCloudPassword";
client.controller(CloudCredential.class).updateOrCreate(
new CloudCredentialBuilder()
.cloud(cloudId)
.secret(secret)
.user(username)
.tenant(1)
.build());
{
"user": "MyCloudUsername",
"secret": "MySecretCloudPassword",
"cloud": 1,
"tenant": 1
}After having created the above entities, the discovery of colosseum will start, importing the various offers (Images, Hardware and Locations) of the cloud provider. You can see the discovered entities, when accessing the corresponding API endpoints.
{: .img-responsive}
{: .img-responsive}
{: .img-responsive}


