OpenStack Connector

OpenStack is a free and open-source software platform for cloud computing, mostly deployed as an Infrastructure-as-a-service (IaaS).The software platform consists of interrelated components that control hardware pools of processing, storage, and networking resources throughout a data center.

With this document guide you will be able to work with and use a OpenStack Connector. While you start configuring the connector, this document will guide you through OpenStack Connector request and response parameters.

Perform all standard application operations like Create, Start and Stop operations available through the OpenStack Connector. Some of them are listed below:

  • Create Server
  • Start Server
  • Stop Server
  • Suspend Server
  • Resume Server
  • List Server
  • Pause Server
  • Unpause Server
  • Describe Server
  • Delete Server

Also,

The ability to set Connector execution timeouts Synchronous / Asynchronous execution of the Connector

Configuring OpenStack Connector

OpenStack

Configuration parameters

ParameterDescriptionrequired
protocolProtocol used to connect to the client target/endpointtrue: config/request
targetHost name or ip-address of the clienttrue: config/request
portPort to connect to the client. Default value is 5000true: config/request
versionVersion of the client on which operation is to be performedtrue: config/request
usernameOpenStack client usernametrue: config/request
passwordOpenStack client passwordtrue: config/request
tenantProject name under which operations are performedtrue: config/request

Example

{
  "protocol" : "https",
  "password":"daniel123",
  "target":"172.16.0.3",
  "tenant":"deniel",
  "username":"deniel",
  "port":5000,
  "version":"v2.0" 
}

Actions

create-server

Create OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: createfalse
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse
servernameName of the server to be createdtrue
flavoridFlavor id required to create servertrue
imageidImage id required to create servertrue
networkidNetwork id required to create servertrue

Response parameters

ParameterDescriptionrequired
responseResponse Body,with operation statustrue

Example

response = @call.connector("openstack_connector")
                .set("action","create")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")
                .set("servername","VM-1")
                .set("flavorid","531961fd-b5a7-4cfd-91aa-014a35e55c95")
                .set("imageid","ce34609e-c374-420d-bef5-d6c7d4bfdf41")
                .set("networkid","0bbfb95f-8a68-48d1-a6e5-03690493e39e")
                .sync
serverid = response.get('serverid') #Response Result, with operation status and serverid of server created.  

start

Start OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: starttrue
serveridId of a particular server which you want to starttrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","start")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

stop

Stop OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: stoptrue
serveridId of a particular server which you want to stoptrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

 response = @call.connector("openstack_connector")
                .set("action","stop")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

suspend

Suspend OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: suspendtrue
serveridId of a particular server which you want to suspendtrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","suspend")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

resume

Resume OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: resumetrue
serveridId of a particular server which you want to resumetrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","resume")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

pause

Pause OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: pausetrue
serveridId of a particular server which you want to pausetrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","pause")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

unpause

Unpause OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: unpausetrue
serveridId of a particular server which you want to unpausetrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","unpause")
                .set("serverid", "bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status. 

list servers

List all the available OpenStack servers.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: listtrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
instance-listResponse Body, details of available instances.true

Example

response = @call.connector("openstack_connector")
                .set("action","list")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

instances_set = response.get('instance-list') #Response Result, with instance-list. 

describe server

Describe a specific server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: describeservertrue
serveridId of a particular server which you want to starttrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
instance-listResponse Body, details of a specific instance.true

Example

response = @call.connector("openstack_connector")
                .set("action","describeserver")
                .set("serverid","bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

instances_set = response.get('instance-list') #Response Result, with instance description. 

list image

List all the available OpenStack images

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: listimagetrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
image-listResponse Body, details of available images.true

Example

response = @call.connector("openstack_connector")
                .set("action","listimage")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

images_set = response.get('image-list') #Response Result, with image-list 

list flavor

List all the available OpenStack flavors

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: listflavortrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
flavor-listResponse Body, details of available flavors.true

Example

response = @call.connector("openstack_connector")
                .set("action","listflavor")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

flavors_set = response.get('flavor-list') #Response Result, with flavor-list 

create snapshot

Create a snapshot of a server

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: createsnapshottrue
serveridId of a particular server of which you want to create snapshottrue
nameName of the snapshot to be createdtrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
imageidResponse Body, imageid of the snapshot created.true

Example

response = @call.connector("openstack_connector")
                .set("action","describeserver")
                .set("serverid","bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("name","VM-1 snapshot")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

image_id = response.get('imageid') #Response Result, with image-id of snapshot created. 

delete

Delete OpenStack server.

Request parameters

ParameterDescriptionrequired
connector_nameName of the OpenStack Connector to be configuredtrue
actionaction to perform: deletetrue
serveridId of a particular server which you want to deletetrue
protocolProtocol used to connect to the client target/endpointfalse
targetHost name or ip-address of the clientfalse
portPort to connect to the client. Default value is 5000false
versionVersion of the client on which operation is to be performedfalse
usernameOpenStack client usernamefalse
passwordOpenStack client passwordfalse
tenantProject name under which operations are performedfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, with operation status and code.true

Example

response = @call.connector("openstack_connector")
                .set("action","delete")
                .set("serverid","bf97b328-79ad-4fd3-8aac-9a92dda6f514")
                .set("protocol","https")
                .set("target","172.16.0.3")
                .set("port",5000)
                .set("version","v2.0")
                .set("username","admin")
                .set("password","admin")
                .set("tenant","admin")

is_success = response.get('is-success')
fault = response.get('fault')
code = response.get('code') #Response Result, with operation status.

Connector request error handling

This is how success or failures can be handled for the connector requests within your Flintbit. This would help to take appropriate action if something failed.

if response.exitcode == 0               # 0 is success.
  @log.info("success")
  # take action in case of success
else                                    # non zero means fail
  @log.error("fail")
  @log.error("Reason:" + response.message)     # get the reason of failure
  ## Take action in case of failure
end
  

On this page: