2. Getting started¶
Described below is a step-by-step walkthrough for building a simple Application Bundle.
Alongside the guide, the following commands that can be used for bundle management are described in this section:
|
Add an Application Bundle |
|
Open the bundle for upgrades, edits etc. |
|
Close an open bundle |
|
Display detailed information about a bundle |
|
List all bundles |
|
Remove an Application Bundle |
|
Register a LXC/KVM image |
|
List all Images |
|
Remove an Application Image |
2.1. Constructing an Application Bundle¶
The following steps describe the process of creating an Nginx Application Bundle.
Note
Nginx is a simple yet popular application that at its core is a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.
Create the necessary directory structure
# mkdir ~/docker-nginx
# cd ~/docker-nginx
# mkdir scripts icons sources
# touch manifest.yaml
# ls
icons manifest.yaml scripts sources
Edit the manifest file
As mentioned previously the manifest file describes the application components, dependencies, resource requirements, hookscripts, execution order etc. The content shown below is sufficient to summarise the Nginx application.
name: Nginx Server
version: "1.12"
description: Nginx
roles: [nginx]
nginx:
name: nginx server
image:
name: nginx
version: 1.12-alpine
engine: docker
In order to understand the contents, detailed below is a line-by-line breakdown of the manifest file.
name: Nginx Server # Name of the bundle
version: "1.12" # Version of the bundle
description: Nginx # Freeform Description
roles: [nginx] # All the roles/services the application requires
nginx: # Section to define the role ‘nginx’
name: nginx server # Name of the role/service
image: # Image section
name: nginx # Name of the docker, kvm, or lxc image
version: 1.12-alpine # Version of the image
engine: docker # Name of engine (docker, kvm or lxc)
The manifest file in this example was kept simple on purpose. More complex examples are available for clustered applications such as Cloudera or Hortonworks.
Create the tar file
The penultimate step in the process involves creating a tar file from the docker-nginx directory
. Issue the following commands to achieve this:
# pwd
/root/docker-nginx
# ls
icons manifest.yaml scripts sources
# tar -cvzf docker-nginx.tar.gz *
icons/
manifest.yaml
scripts/
sources/
# ls
docker-nginx.tar.gz icons manifest.yaml scripts sources
Upload the bundle
The final step involves adding the bundle to the Robin Cluster so it can be utilized to deploy applications. Issue the following command to add the bundle:
# robin robin bundle add nginx 1.1.13 docker-nginx.tar.gz
File upload: 100% -- (324/324)
Job: 368 Name: BundleAdd State: VALIDATED Error: 0
Job: 368 Name: BundleAdd State: COMPLETED Error: 0
Bundle ‘nginx-1.1.13' was uploaded successfully
# robin bundle list
Bundle Id | Type | Owner/Tenant | Name | Version | Zone Id | Content Id | Description | Group Id | #Templates | #Apps
----------+-------+----------------------+--------+---------+------------+----------------------------------+-------------+----------+------------+-------
1 | ROBIN | robin/Administrators | cenots | 7 | 1583384576 | 97739a119b9551d293719af705553f78 | - | 1 | 0 | 3
2 | ROBIN | robin/Administrators | nginx | 1.1.13 | 1583384576 | 504a04955317e2aff3dd29027de4046c | - | 2 | 0 | 0
An application can now be created from the bundle either via the UI or on the CLI via the robin app create from-bundle
command.
2.2. Managing Application Bundles¶
Detailed below are a set of native Robin commands that aid in the management of Application Bundles.
2.2.1. Adding a Bundle¶
In order to add a Bundle to a Robin cluster such that an application can be deployed from it, issue the following command:
# robin bundle add <name> <version> <path_to_file>
--collection-id <collection_id>
--image <image>
--groupid <groupid>
--parentid <parentid>
--msg <msg>
--integrity_check
|
Name to assign to bundle being added |
|
Version of the bundle being added |
|
File path of the bundle to upload or URL of the bundle |
|
ID of the collection the bundle should be uploaded to |
|
File path of the image for LXC and KVM based applications. If specified the image will be implicitly registered |
|
ID of the group the bundle should be added to. If not specified a new group will be created containing only the bundle |
|
ID of the bundle’s parent bundle. If not specified the bundle becomes a parent bundle |
|
Description of the bundle |
|
Send a checksum to ensure integrity of uploaded file |
Example:
# robin bundle add nginx 1.1.13 docker-nginx.tar.gz --wait
File upload: 100% -- (324/324)
Job: 368 Name: BundleAdd State: VALIDATED Error: 0
Job: 368 Name: BundleAdd State: COMPLETED Error: 0
Bundle ‘nginx-1.1.13' was uploaded successfully
Adds an Application Bundle to a Robin cluster such that an application can be deployed from it. Note this is a two step process as outlined by the example API requests detailed below.
Uploading the bundle to the file server
End Point: /api/v3/file_server/file-objects
Method: POST
URL Parameters:
collection_name: <collection_name>
- This mandatory parameter within the url specifies the name of the collection the bundle should be uploaded to.
Data Parameters:
@<bundle_pathname>
- This mandatory parameter specifies the file path of the bundle to be uploaded.
Note
This parameter should be specified via the
--data-binary
attribute for a cURL request or any equivalent property.Port: File Server Port (default value is 29445)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-Acfile
: Indicates that an archive file is to be uploaded.X-File-Object-Type: Archive
: Indicates that the file object type for bundles is ‘Archive’.X-File-Name: <bundle_file_name>
: The file name of the bundle to be uploaded.X-File-Size: <bundle_file_size
: The size of the bundle in bytes.X-Name: <bundle_name>
: The name that should be associated with the bundle being uploaded.X-Version: <bundle_version>
: The version of the bundle being uploaded.
Success Response Code: 200
Error Response Code: 500 (Internal Server Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error), 409 (Duplicate Resource Error)
Example Response:
Output
{ "file_object":{ "archive_name":"demo-v1", "md5_hash":"e6f617ce0b777bb9e4f5cbe937a13243", "type":"Archive", "create_time":"November 16, 2020 03:07:57", "collection_host":"vnode-95-42.robinsystems.com", "version":"v1", "collection_id":1599768866069, "file_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069\/1605496077467\/docker-centos-7-621_master.tar.gz", "name":"demo", "archive_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069\/1605496077467\/demo-v1", "archive":true, "id":7, "collection_name":"file-collection-1599768866069", "file_object_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069\/1605496077467", "collection_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069", "file_name":"docker-centos-7-621_master.tar.gz", "file_size":57131, "object_id":1605496077467 } }
Registering the bundle with the Robin cluster
End Point: /api/v3/robin_server/bundles/
Method: POST
URL Parameters: None
Data Parameters:
name: <bundle_name>
- This mandatory parameter within the payload specifies the name to be associated with the bundle being added.version: <bundle_version>
- This mandatory parameter within the payload specifies the version of the bundle being added.file_object_id: <object_id>
- This mandatory parameter within the payload specifies the File Object ID of bundle that was previously uploaded to the file server.type: ROBIN
- This mandatory parameter within the payload specifies that the type of bundle being uploaded is ‘ROBIN’.groupid: <group_id>
- Utilizing this parameter, by specifiying an integer representing a group’s ID, results in the bundle being added to the group associated with the ID specified. If not specified a new group will be created containing only the bundle.parentid: <parent_id>
- Utilizing this parameter, by specifiying an integer representing a parent bundle ID, results in the bundle being added as a child bundle. If not specified the bundle becomes a parent bundle.description: <description>
- Utilizing this parameter, by specifiying a string, results in the bundle’s description being set to the given message.
Note
The File Object ID of the bundle can be found in the response of the previously detailed API.
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-Action: create_bundle
: Indicates that the create bundle action is to be performed.
Success Response Code: 202
Error Response Code: 500 (Internal Server Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error), 409 (Duplicate Resource Error)
Example Response:
Output
{ "plan":{ "file_object_id":"1605496077467", "type":"ROBIN", "name":"demo", "user":{ "ip_addr":"10.9.95.42", "user_permissions":{ }, "username":"robin", "user_id":3, "tenants":[ "t2", "Administrators" ], "session_expires":"2020-11-17T03:03:15", "tenant":"Administrators", "namespace":"random", "permissions":{ "K8S_NODE":{ "update":"GLOBAL", "view":"GLOBAL" }, "STORAGE_REPO":{ "share":"GLOBAL", "create":"GLOBAL", "tenant_unshare":"GLOBAL", "scan":"GLOBAL", "tenant_share":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "user_share":"GLOBAL", "purge":"GLOBAL", "user_unshare":"GLOBAL", "unshare":"GLOBAL", "push":"GLOBAL", "reclaim":"GLOBAL", "delete":"GLOBAL" }, "K8S_TILLER":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "SYSTEM":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL" }, "WATCHDOG":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "IPPOOL":{ "create":"GLOBAL", "remove_ranges":"GLOBAL", "update":"GLOBAL", "add_ranges":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "rename":"GLOBAL" }, "STORAGE_ARRAY":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "RESOURCE_MANAGER":{ "view":"GLOBAL" }, "CONSOLE":{ "view":"GLOBAL" }, "USER_CAPABILITY":{ "update":"NONE", "create":"NONE", "view":"GLOBAL", "delete":"NONE" }, "CERT":{ "view":"GLOBAL" }, "LICENSE":{ "update":"GLOBAL", "view":"GLOBAL" }, "REPO_CATALOG":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "ANALYTICS":{ "create":"GLOBAL", "view":"GLOBAL" }, "K8S_ROLE_BINDING":{ "view":"GLOBAL" }, "K8S_CLUSTER_ROLE":{ "view":"GLOBAL" }, "TEST":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "test":"GLOBAL" }, "METRICS":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL" }, "K8S_BACKUP":{ "create":"GLOBAL", "tenant_unshare":"GLOBAL", "purge":"GLOBAL", "tenant_share":"GLOBAL", "user_unshare":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "user_share":"GLOBAL", "import":"GLOBAL", "export":"GLOBAL" }, "DISK":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "K8S_APPLICATION":{ "share":"GLOBAL", "create":"GLOBAL", "hydrate":"GLOBAL", "update":"GLOBAL", "register":"GLOBAL", "config":"NONE", "view":"GLOBAL", "change_owner":"GLOBAL", "restore":"GLOBAL", "remove_repo":"GLOBAL", "add_repo":"GLOBAL", "setsnapback":"GLOBAL", "backup":"GLOBAL", "snapshot":"GLOBAL", "unshare":"GLOBAL", "rollback":"GLOBAL", "delete":"GLOBAL", "unregister":"GLOBAL", "clone":"GLOBAL" }, "K8S_CLUSTER_ROLE_BINDING":{ "view":"GLOBAL" }, "K8S_USER_AUTH":{ "view":"GLOBAL" }, "IMAGE":{ "create":"GLOBAL", "tenant_share":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "rename":"GLOBAL", "change_owner":"GLOBAL" }, "ZONE":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "JOB":{ "view":"GLOBAL", "delete":"GLOBAL" }, "K8S_NAMESPACE":{ "view":"GLOBAL" }, "NOTIFICATION":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "SCHEDULER":{ "update":"GLOBAL", "view":"GLOBAL" }, "K8S_KUBE_CONFIG":{ "view":"GLOBAL" }, "OBJECT_TYPE":{ "view":"NONE" }, "NFS_EXPORTS":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "OBJECT_SHARE":{ "view":"GLOBAL" }, "DOCKER_REGISTRY":{ "create":"GLOBAL", "tenant_share":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "change_owner":"GLOBAL" }, "LDAP":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "CHARGEBACK":{ "update":"GLOBAL", "view":"GLOBAL" }, "VLAN":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "EVENT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL" }, "K8S_USER_CONTEXT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "DASHBOARD":{ "view":"GLOBAL" }, "VOLUME":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "LOG_COLLECT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "MANAGER_CONFIG":{ "view":"GLOBAL" }, "WORKFLOW":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "MGMT_TOKEN":{ "view":"GLOBAL" }, "RESOURCE_GROUP":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "K8S_DEPLOYMENT":{ "view":"GLOBAL" }, "FILE_COLLECTION":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "NODE":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "BUNDLE":{ "create":"GLOBAL", "tenant_share":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "rename":"GLOBAL", "change_owner":"GLOBAL" }, "K8S_ROLE":{ "view":"GLOBAL" }, "USER":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "update_role":"GLOBAL" }, "CLOUD":{ "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "CSI_TOKEN":{ "view":"GLOBAL" }, "CONFIG":{ "update":"GLOBAL", "view":"GLOBAL" }, "TRIGGER":{ "view":"GLOBAL" }, "TENANT":{ "create":"GLOBAL", "manage_resources":"GLOBAL", "update":"GLOBAL", "delete":"GLOBAL", "view":"GLOBAL", "add_users":"GLOBAL" }, "SNAPSHOT":{ "update":"GLOBAL", "share":"GLOBAL", "view":"GLOBAL", "unshare":"GLOBAL" }, "K8S_CONTEXT":{ "view":"GLOBAL" }, "NAMESPACE":{ "create":"GLOBAL", "view":"GLOBAL", "user_unshare":"GLOBAL", "update":"GLOBAL", "deploy_app":"GLOBAL", "delete":"GLOBAL", "user_share":"GLOBAL", "change_owner":"GLOBAL" }, "USER_AUTH":{ "view":"GLOBAL" }, "APPLICATION":{ "freeze":"GLOBAL", "moveresources":"GLOBAL", "scale":"GLOBAL", "manage_instances":"GLOBAL", "update":"GLOBAL", "start":"GLOBAL", "snapshot":"GLOBAL", "change_owner":"GLOBAL", "restore":"GLOBAL", "unfreeze":"GLOBAL", "setreslimits":"GLOBAL", "create":"GLOBAL", "register":"NONE", "addkey":"GLOBAL", "rollback":"GLOBAL", "redeploy":"GLOBAL", "addvol":"GLOBAL", "storageqos":"GLOBAL", "delete":"GLOBAL", "unregister":"NONE", "share":"GLOBAL", "computeqos":"GLOBAL", "view":"GLOBAL", "deltrigger":"GLOBAL", "restart":"GLOBAL", "remove_repo":"GLOBAL", "add_repo":"GLOBAL", "probe":"GLOBAL", "expandvol":"GLOBAL", "run_hook":"GLOBAL", "addtrigger":"GLOBAL", "stop":"GLOBAL", "delete_backup":"GLOBAL", "hydrate":"GLOBAL", "setsnapback":"GLOBAL", "config":"GLOBAL", "delvol":"GLOBAL", "upgrade":"GLOBAL", "snapshot_limits":"GLOBAL", "backup":"GLOBAL", "update_hpa":"GLOBAL", "evacuate":"GLOBAL", "unshare":"GLOBAL", "clone":"GLOBAL" }, "REPORT":{ "view":"GLOBAL" }, "BACKUP":{ "create":"GLOBAL", "tenant_unshare":"GLOBAL", "tenant_share":"GLOBAL", "user_unshare":"GLOBAL", "update":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL", "user_share":"GLOBAL" }, "USER_AUDIT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "FILE_OBJECT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "INSTANCE":{ "stop":"GLOBAL", "computeqos":"GLOBAL", "start":"GLOBAL", "relocate":"GLOBAL", "setstate":"GLOBAL", "view":"GLOBAL", "repair":"GLOBAL", "restart":"GLOBAL", "change_owner":"GLOBAL", "update":"GLOBAL", "addvol":"GLOBAL", "delete":"GLOBAL" }, "FILE":{ "view":"GLOBAL" }, "PRIVILEGED_APP":{ "create":"GLOBAL" }, "OPERATION":{ "view":"GLOBAL" }, "TAG":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "RESOURCEPOOL":{ "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "K8S_MASTER":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "K8S_USER":{ "view":"GLOBAL" }, "LIMIT":{ "update":"GLOBAL", "create":"GLOBAL", "view":"GLOBAL", "delete":"GLOBAL" }, "MANAGER":{ "view":"GLOBAL" } }, "user_contexts":[ "robin", "robin" ], "tenant_id":1, "user_context":"robin", "user_capabilities":[ "AllSuperAdminCapabilities" ], "tenant_role":"superadmin" }, "version":"v1" }, "jobid":565 }
2.2.2. Opening a Bundle¶
In certain scenarios an Application Bundle might need to be edited due to a misconfiguration in the manifest, a hookscript might need to be updated/fixed etc. In order to access the contents of the bundle and consequently have the ability to edit the files within, issue the following command:
# robin bundle open <bundleid>
|
Id of Application Bundle to edit |
Note
When this command is run Robin creates a shell along with a temporary directory containing the contents of the specified bundle. Changes made to the files here will only be reflected on the actual Application Bundle files if saved via the robin bundle close
command.
Example:
# robin bundle open 2
[ .2]# ls
icons manifest.yaml scripts sources
Note
All the files (including the manifest file) within the current and existing directories can be edited in any manner necessary.
2.2.3. Closing a Bundle¶
In order to undo or save changes made for an Application Bundle that has been opened and thus exit the shell, issue the following command:
# robin bundle close <bundleid>
--commit <version>
--msg <message>
|
Id of Application Bundle to edit |
|
Perform a commit thats saves the new bundle with provided bundle version |
|
Description of the commit |
Note
If the --commit
option is not provided, the changes made to the Application Bundle will not be persisted. In addition this command can be used to aid the versioning of Application Bundles.
Example:
# robin bundle close 2 --commit 1.1.14
File upload: 100% -- (341/341)
Job: 369 Name: BundleAdd State: VALIDATED Error: 0
Job: 369 Name: BundleAdd State: COMPLETED Error: 0
# robin bundle list
Bundle Id | Type | Owner/Tenant | Name | Version | Zone Id | Content Id | Description | Group Id | #Templates | #Apps
----------+-------+----------------------+--------+---------+------------+----------------------------------+-------------+----------+------------+-------
1 | ROBIN | robin/Administrators | centos | 7 | 1583384576 | 97739a119b9551d293719af705553f78 | - | 1 | 0 | 3
2 | ROBIN | robin/Administrators | nginx | 1.1.13 | 1583384576 | 504a04955317e2aff3dd29027de4046c | - | 2 | 0 | 0
3 | ROBIN | robin/Administrators | nginx | 1.1.14 | 1583384576 | a31f032ca5fb31f5324373052f95dcd4 | - | 2 | 0 | 0
2.2.4. Show information about a specific Bundle¶
To view the details of a bundle, issue the following command:
# robin bundle info <bundleid>
--files
--templates
--manifest
--all
--json
|
Bundle ID |
|
List bundle files |
|
Show templates |
|
Show bundle manifest |
|
Enable all optional additional parameters |
|
Output in JSON |
Example:
# robin bundle info 1
Zone ID : 1650332413
Bundle ID : centos
Bundle Name : 7
Group ID : 1
Bundle Owner : admin
Bundle Tenant : Administrators
Number of apps : 4
Collection ID : 1650462288460
Group details:
BundleId | Owner/Tenant | Name | Version | ContentId | CreateTime | Description | #Templates | #Apps | Parent | #Children
---------+----------------------+--------+---------+----------------------------------+-------------------------+-------------+------------+-------+--------+-----------
1* | admin/Administrators | centos | 7 | 4a29e761697a4aa180ee9387439478b4 | April 20, 2022 13:45:26 | - | 2 | 4 | | 0
2.2.5. Listing Bundles¶
In order to list all bundles that are currently available for use (whether they have been added or edited and committed) alongside additional details such as each bundles version, content ID and description, issue the following command:
# robin bundle list --group --json
--group
Display Bundle groupings
--json
Output in JSON format
Example:
# robin bundle list Bundle Id | Owner/Tenant | Name | Version | #Versions | Zone Id | Description | Group Id | #Templates | #Apps ———-+———————-+——————+———+———–+————+————-+———-+————+——- 1 | robin/Administrators | centos | 7.1 | 1 | 1597096579 | - | 1 | 0 | 0 2 | robin/Administrators | nfs | 2.3.2 | 1 | 1597096579 | - | 2 | 0 | 0 3 | robin/Administrators | postgres-ha | 11.1 | 1 | 1597096579 | - | 3 | 0 | 0 4 | robin/Administrators | mysql | 7 | 1 | 1597096579 | - | 4 | 0 | 0 5 | robin/Administrators | storge-benchmark | 1 | 1 | 1597096579 | - | 5 | 0 | 0 6 | robin/Administrators | scylla | 3.2.1 | 1 | 1597096579 | - | 6 | 0 | 0 7 | robin/Administrators | elasticsearch | 5.4.0 | 1 | 1597096579 | - | 7 | 0 | 0 8 | robin/Administrators | elk | 6.8.10 | 1 | 1597096579 | - | 8 | 0 | 0 9 | robin/Administrators | es-kafka | 6.3.2 | 1 | 1597096579 | - | 9 | 0 | 0 10 | robin/Administrators | nginx-hpa | 1.0 | 1 | 1597096579 | - | 10 | 0 | 0 11 | robin/Administrators | ubuntu | 17.10 | 1 | 1597096579 | - | 11 | 1 | 0 12 | robin/Administrators | xfs | 1 | 1 | 1597096579 | - | 12 | 31 | 30
Returns all bundles that are currently available for use alongside additional details such as each bundles version, content ID and description.
End Point: /api/v5/robin_server/bundles/
Method: GET
URL Parameters: None
Data Parameters: None
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-File-Port: <file_server_port>
: Port on which the File Server is listening on; by default this is 29445. Note the value of this field should be a string.
Success Response Code: 200
Error Response Code: 500 (Internal Server Error)
Example Response:
Output
{
"bundles":[
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"icon.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":1,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"7.1",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"f972a5725d1bfe2671a79d61856f872a",
"user":"robin",
"groupid":1,
"name":"centos",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"icon.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":2,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"2.3.2",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"e97ae60314f469fd58d8d1e54d02f4b9",
"user":"robin",
"groupid":2,
"name":"nfs",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"postgresql_logo.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":3,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"11.1",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"4882d6d6b8c927fe1377084352a4aca1",
"user":"robin",
"groupid":3,
"name":"postgres-ha",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"mysql.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":4,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"7",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"4ff5e02e91021625b0ee8cd3b904685d",
"user":"robin",
"groupid":4,
"name":"mysql",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"logo.jpg"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":5,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"1",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"6d2b845fadf28a2a2f03f4c5de73c6c3",
"user":"robin",
"groupid":5,
"name":"storge-benchmark",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"icon.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":6,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"3.2.1",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"ab5b427aa6d2786cfe12939a10983a94",
"user":"robin",
"groupid":6,
"name":"scylla",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"elastic.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":7,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"5.4.0",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"17cb02cf0e647325b6b80792f45a73c4",
"user":"robin",
"groupid":7,
"name":"elasticsearch",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"elastic.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":8,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"6.8.10",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"edd75613f25601e7d269b31e3f31b985",
"user":"robin",
"groupid":8,
"name":"elk",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"elastic.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":9,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"6.3.2",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"da86439fe9eaf667e16baa405b627217",
"user":"robin",
"groupid":9,
"name":"es-kafka",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"nginx.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":10,
"type":"ROBIN",
"ntemplates":0,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"1.0",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"eb023f398a192db843c2701f29066825",
"user":"robin",
"groupid":10,
"name":"nginx-hpa",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"icon.png"
],
"tenants":[
"Administrators",
"t1"
],
"bundleid":11,
"type":"ROBIN",
"ntemplates":1,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"17.10",
"tenant":"Administrators",
"share_with_all_tenants":true,
"content_id":"29e369e2c596f653df6fd5a4167b5ad2",
"user":"robin",
"groupid":11,
"name":"ubuntu",
"napps":0,
"description":""
},
{
"parent":"",
"zoneid":1597096579,
"parentid":null,
"icons":[
"logo.jpg"
],
"tenants":[
"Administrators"
],
"bundleid":12,
"type":"ROBIN",
"ntemplates":31,
"userid":3,
"collection_id":1597074384939,
"nb_collections":0,
"version":"1",
"tenant":"Administrators",
"share_with_all_tenants":false,
"content_id":"69899dc85fc840017f2e44d7551497c2",
"user":"robin",
"groupid":12,
"name":"xfs",
"napps":30,
"description":""
}
]
}
2.2.6. Removing a Bundle¶
In order to remove an Application Bundle from a Robin cluster, issue the following command:
# robin bundle remove <zoneid> <bundleid>
--force
--yes
|
Id of zone in which the bundle is deployed |
|
Id of Application Bundle to remove |
|
Forcefully delete a bundle if the underlying storage is down |
|
Do not prompt the user for confirmation |
Note
Before removing a bundle, all applications deployed from the respective bundle must be deleted.
Example:
# robin bundle remove 1599768542 2 --wait
Are you sure you want to delete [y/n] ? y
Job: 437 Name: BundleRemove State: VALIDATED Error: 0
Job: 437 Name: BundleRemove State: PREPARED Error: 0
Job: 437 Name: BundleRemove State: FINALIZED Error: 0
Job: 437 Name: BundleRemove State: COMPLETED Error: 0
Removes an Application Bundle from a Robin cluster.
End Point: /api/v3/robin_server/bundles/<bundle_id>
Method: DELETE
URL Parameters:
zoneid=<zoneid>
: This mandatory parameter within the URL specifies the ID of the zone in which the bundle reside.force=true
: Utilizing this parameter results in the forecful delete a bundle if the underlying storage is down.
Data Parameters: None
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.
Success Response Code: 202
Error Response Code: 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error)
Example Response:
Output
{
"plan":{
"zoneid":"1599768542",
"bundleid":"3"
},
"jobid":446
}
2.3. Managing Images¶
Detailed below are a set of native Robin commands that enable users to manage LXC and KVM (qcow2) images which are used for applications deployed by the respective engines.
2.3.1. Register an Image¶
In order to add an LXC or KVM (qcow2) image to a Robin cluster, issue the following command:
# robin image add <name> <version> <image_type> <path> <collection_id>
--registry <registry>
--integrity_check
|
Name to assign to image being registered |
|
Version of the image being registered |
|
Type of image being registered. Valid choices include ‘LXC’ and ‘QCOW’ |
|
File path of the image to be uploaded or url of image in registry |
|
ID of the collection the image should be uploaded to |
|
Name of registry that has been pre-registered with Robin to download the images from |
|
Send a checksum to ensure integrity of uploaded image |
Note
Before an LXC or KVM bundle can be added the respective image(s) that they refer to must be registered.
Example:
# robin image add centos v1 QCOW ~/centos-kvm/CentOS-7-x86_64-GenericCloud-1907-100G.qcow2 1604895848923
File upload: 100% -- (998113280/998113280)
Job: 84 Name: ImageAdd State: VALIDATED Error: 0
Job: 84 Name: ImageAdd State: COMPLETED Error: 0
Adds an Application QCOW Image to a Robin cluster such that an application can be deployed from it. Note this is a two step process as outlined by the example API requests detailed below. However if the application image in question is being directly uploaded from a registry only the second API request needs to be sent with the appropriate registry
and image_url
parameters specified in the headers.
Uploading the image to the file server
End Point: /api/v3/file_server/file-objects
Method: POST
URL Parameters:
collection_name: <collection_name>
- This mandatory parameter within the url specifies the name of the collection the image should be uploaded to.
Data Parameters:
@<image_pathname>
- This mandatory parameter specifies the file path of the image to be uploaded.
Note
This parameter should be specified via the
--data-binary
attribute for a cURL request or any equivalent property.Port: File Server Port (default value is 29445)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-File-Object-Type: File
: Indicates that the file object type for images is ‘File’.X-File-Name: <image_file_name>
: The file name of the image to be uploaded.X-File-Size: <image_file_size>
: The size of the image in bytes.X-Name: <image_name>
: The name that should be associated with the image being uploaded.X-Version: <image_version>
: The version of the image being uploaded.X-Image-Type: <image_type>
: The type of the image. Valid values include ‘QCOW’ and ‘LXC’.
Success Response Code: 200
Error Response Code: 500 (Internal Server Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error), 409 (Duplicate Resource Error)
Example Response:
Output
{ "file_object":{ "archive_name":null, "md5_hash":"-", "type":"File", "create_time":"December 02, 2020 19:01:51", "collection_host":"vnode-95-42.robinsystems.com", "version":"v1", "collection_id":1599768866069, "file_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069\/1606935712004\/CentOS-7-x86_64-GenericCloud-1907.qcow2", "name":"centos-kvm", "archive_path":null, "archive":false, "id":8, "collection_name":"file-collection-1599768866069", "file_object_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069\/1606935712004", "collection_path":"\/usr\/local\/robin\/collections\/file-collection-1599768866069", "file_name":"CentOS-7-x86_64-GenericCloud-1907.qcow2", "file_size":942407680, "object_id":1606935712004 } }
Registering the image with the Robin cluster
End Point: /api/v3/robin_server/images/
Method: POST
URL Parameters: None
Data Parameters: None
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-Action: create_image
: Indicates that the create image action is to be performed.X-File-Object-Id: <image_file_object_id
: The File Object ID of image that was previously uploaded to the file server. Note this header is not needed if the registry parameter is specified.X-Name: <image_name>
: The name that should be associated with the image being uploaded.X-Version: <image_version>
: The version of the image being uploaded.X-Image-Type: <image_type>
: The type of the image. Valid values include ‘QCOW’ and ‘LXC’.X-Registry: <registry>
: The name of registry that has been pre-registered with Robin to download the images from.X-Image-Url: <image_url>
: URL of the images within the aforementioned registry. This option is only valid with the registry parameter is specified.
Note
The File Object ID of the image can be found in the response of the previously detailed API.
Success Response Code: 202
Error Response Code: 500 (Internal Server Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error), 409 (Duplicate Resource Error)
Example Response:
Output
{ "plan":{ "name":"centos-kvm", "file_object_id":1606935712004, "version":"v1", "image_type":"QCOW" }, "jobid":630 }
2.3.2. Listing Images¶
In order to list all images that are currently available for use alongside additional details such as each version, content ID and description, issue the following command:
# robin image list --json
|
Output in JSON format |
Example:
# robin image list
Image Id | Owner/Tenant | Name | Version | Format | Content Id | File Object Id | File Name
---------+----------------------+------+----------+--------+----------------------------------+----------------+---------------------------------
1 | robin/Administrators | vnf1 | 3.0-1094 | QCOW | 76073497a3456d195d241898dc654c6f | 1604952162758 | vnf1-vf_3.0-1094.qcow2
2 | robin/Administrators | vnf2 | 3.0-1094 | QCOW | 9f1781b24892f3ce543a7ec7638904b3 | 1604962667747 | vnf2-vf_3.0-1094.qcow2
Returns all bundles that are currently available for use alongside additional details such as each bundles version, content ID and description.
End Point: /api/v3/robin_server/images/
Method: GET
URL Parameters: None
Data Parameters: None
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.X-File-Port: <file_server_port>
: Port on which the File Server is listening on; by default this is 29445. Note the value of this field should be a string.
Success Response Code: 200
Error Response Code: 500 (Internal Server Error)
Example Response:
Output
{
"items":[
{
"tenant":"Administrators",
"pathname":"\/usr\/local\/robin\/collections\/file-collection-1604953959397\/1604952162758\/vnf1-vf_3.0-1094.qcow2",
"version":"3.0-1094",
"zoneid":1604734383,
"format":"QCOW",
"collection_id":1604953959397,
"id":1,
"name":"vnf1",
"file_object_id":1604952162758,
"file_name":"vnf1-vf_3.0-1094.qcow2",
"user":"robin",
"share_with_all_tenants":false,
"collection_path":"\/usr\/local\/robin\/collections\/file-collection-1604953959397",
"md5_hash":"76073497a3456d195d241898dc654c6f",
"tenants":[
"Administrators"
],
"create_time":"November 09, 2020 12:02:42"
},
{
"tenant":"Administrators",
"pathname":"\/usr\/local\/robin\/collections\/file-collection-1604953959397\/1604962667747\/vnf2-vf_3.0-1094.qcow2",
"version":"3.0-1094",
"zoneid":1604734383,
"format":"QCOW",
"collection_id":1604953959397,
"id":2,
"name":"vnf2",
"file_object_id":1604962667747,
"file_name":"vnf2-vf_3.0-1094.qcow2",
"user":"robin",
"share_with_all_tenants":false,
"collection_path":"\/usr\/local\/robin\/collections\/file-collection-1604953959397",
"md5_hash":"9f1781b24892f3ce543a7ec7638904b3",
"tenants":[
"Administrators"
],
"create_time":"November 09, 2020 14:57:47"
}
]
}
2.3.3. Removing an Image¶
In order to remove an Application Image from a Robin cluster, issue the following command:
# robin image remove <imageid>
--yes
|
Id of Application Image to remove |
|
Do not prompt the user for confirmation |
Note
Before removing an image, all applications deployed from the respective bundle must be deleted and all bundles referring to the image must also be removed.
Example:
# robin image remove 2 --wait
Are you sure you want to delete [y/n] ? y
Job: 438 Name: ImageRemove State: VALIDATED Error: 0
Job: 438 Name: ImageRemove State: PREPARED Error: 0
Job: 438 Name: ImageRemove State: COMPLETED Error: 0
Removes an Application Image from a Robin cluster.
End Point: /api/v3/robin_server/images/<image_id>
Method: DELETE
URL Parameters: None
force=true
: Utilizing this parameter results in the forecful delete of an image if the underlying storage is down.
Data Parameters: None
Port: RCM Port (default value is 29442)
Headers:
Authorization: <auth_token>
: Authorization token to identify which user is sending the request. The token can be acquired from the login API.
Success Response Code: 202
Error Response Code: 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error)
Example Response:
Output
{
"plan":{
"imageid":"2"
},
"jobid":438
}