Microsoft Azure is a cloud computing platform and infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed data centers.

With this document, we will be able to use and work with the Microsoft Azure Connector.

Design Aspects

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

  • List virtual machine
  • Create virtual machine
  • Start virtual machine
  • Stop virtual machine
  • Reboot virtual machine
  • Details virtual machine
  • Delete virtual machine

Connector Configuration

Configuration parameters
ParameterDescriptionRequired
instance-nameMicrosoft Azure instance nametrue: config/request
group-nameMicrosoft Azure group name in which instance to be createdtrue: config/request
keyMicrosoft Azure keyfalse: config/request
client-idMicrosoft Azure unique client id false: config/request
tenant-idMicrosoft Azure unique tenant id false: config/request
subscription-idMicrosoft Azure unique subscription idfalse: config/request
Example
{
"instance-name":"Server-1",
"group-name":"RESOURCEGROUP"
"key":"5Wi6KdsksmlIjHQ96ZmknJqhx86782645784",
"client-id":"fcaaddda-7a23-443f-645487777732452sfef",
"tenant-id": "99cf556e-0321-4de2-8226-9908098hhi",
"subscription-id": "3c089816-8074-0808ghiuh-bdbf-3a567e94946f",
}

 

Actions

list-virtual machine

List Instance on Azure from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the Microsoft Azure Connector to be configured.true
actionContains the name of the operation: list-instancetrue
keyMicrosoft Azure keytrue
client-idMicrosoft Azure unique client idtrue
tenant-idMicrosoft Azure unique tenant idfalse
subscription-idMicrosoft Azure unique subscription idtrue
Response parameters
ParameterDescription
instance_setMicrosoft Azure created instance info set
Example
 
response = @call.connector(@connector_name)
                          .set('action', @action)
                          .set('tenant-id', @tenant_id)
                          .set('subscription-id', @subscription_id)
                          .set('key', @key)
                          .set('client-id', @client_id)
 
#Microsoft Azure Connector Response Meta Parameters
response_exitcode = response.exitcode	# Exit status code
response_message = response.message	# Execution status messages

#Microsoft Azure Connector Response Parameters
instance_set = response.get("vm-list")

 

start-virtual machine

Start Instance on Azure from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the Microsoft Azure Connector to be configured.true
actionContains the name of the operation: list-instancetrue
keyMicrosoft Azure keytrue
client-idMicrosoft Azure unique client idtrue
tenant-idMicrosoft Azure unique tenant idfalse
subscription-idMicrosoft Azure unique subscription idtrue
Response parameters
ParameterDescription
started-instances-setAmazon EC2 started instance info set
Example
 
response = @call.connector(@connector_name)
                          .set('action', @action)
                          .set('tenant-id', @tenant_id)
                          .set('subscription-id', @subscription_id)
                          .set('key', @key)
                          .set('group-name',@group_name)
                          .set('client-id', @client_id)

#Microsoft Azure Connector Response Meta Parameters
response_exitcode = response.exitcode	# Exit status code
response_message = response.message	# Execution status messages
 

stop-virtual machine

Stop Instance on Azure from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the Microsoft Azure Connector to be configured.true
actionContains the name of the operation: list-instancetrue
keyMicrosoft Azure keytrue
client-idMicrosoft Azure unique client idtrue
tenant-idMicrosoft Azure unique tenant idfalse
subscription-idMicrosoft Azure unique subscription idtrue
Response parameters
ParameterDescription
stop-instance-listAmazon EC2 stopped instance info set
Example

response = @call.connector("amazon-ec2")
                    .set("action","stop-instances")
                    .set("instance_id","i-1a2b3cd")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync
#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode               #Exit status code
response_message = response.message                 #Execution status messages

#Amazon EC2 Connector Response Parameters
instances_set=response.get("stop-instance-list")    #Set of Amazon EC2 stopped instances

instances_set.each do |instance_id|
    @log.info("Amazon EC2 Instance current state : #{instance_id.get("current-state")} | previous state : #{instance_id.get("previous-state")} | Instance ID : #{instance_id.get("instance-id")}")
end

 

terminate-instances

Terminate Instance on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: terminate-instancestrue
instance-idContains one or more instance IDs corresponding to the instances that you want to terminate, supplied within an array of stringstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
terminated-instance-setAmazon EC2 terminated instance info set
Example
response = @call.connector("amazon-ec2")
                    .set("action","terminate-instances")
                    .set("instance_id","i-1a2b3cd")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode                    #Exit status code
response_message = response.message                      #Execution status messages

#Amazon EC2 Connector Response Parameters
instances_set = response.get("terminated-instance-set")  #Set of Amazon EC2 terminated instances

instances_set.each do |instance_id|
    @log.info("Amazon EC2 Instance current state : #{instance_id.get("current-state")} | previous state : #{instance_id.get("previous-state")} Instance ID : #{instance_id.get("instance-id")}")
end 

 

reboot-instances

Reboot Instance on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: reboot-instancestrue
instance-idContains one or more instance IDs corresponding to the instances that you want to reboot, supplied within an array of stringstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
reboot-instance-idAmazon EC2 rebooted instance info set
Example
 
response = @call.connector("amazon-ec2")
                    .set("action","reboot-instances")
                    .set("instance_id","i-1a2b3cd")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode                   #Exit status code
response_message = response.message                     #Execution status messages

#Amazon EC2 Connector Response Parameters
instances_set=response.get("reboot-instance-id")        #Set of Amazon EC2 rebooted instances

instances_set.each do |instance_id|
    @log.info("Amazon EC2 rebooted instance : #{instance_id.to_s}")
end 

 

describe-instances

Describe Instance on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: describe-instancestrue
instance-idContains one or more instance IDs corresponding to the instances that you want to describe, supplied within an array of stringstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
reboot-instance-idAmazon EC2 rebooted instance info set
Example

 
response = @call.connector("amazon-ec2")
                    .set("action","describe-instances")
                    .set("instance_id","i-1a2b3cd")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode                   #Exit status code
response_message = response.message                     #Execution status messages
instances_set = response.get("instances-info")           #Set of Amazon EC2 instances

instances_set.each do |instance|
    @log.info("Amazon EC2 instance image id : #{instance.get("image-id")} | public ip : #{instance.get("public-ip")} | instance type : #{instance.get("instance-type")} | key-name : #{instance.get("key-name")} | private ip : #{instance.get("private-ip")} | hypervisor : #{instance.get("hypervisor")} | kernel id : #{instance.get("kernel-id")} | instance id : #{instance.get("instance-id")} | architecture : #{instance.get("architecture")} | client-token : #{instance.get("client-token")} | instance-lifecycle : #{instance.get("instance-lifecycle")} | platform : #{instance.get("platform")} | state code : #{instance.get("instance-state-code")} | state name : #{instance.get("instance-state-name")} | ramdisk id : #{instance.get("ramdisk-id")} | ebs optimized : #{instance.get("ebs-optimized")} | placement tenancy : #{instance.get("placement-tenancy")} | placement group name : #{instance.get("placement-group-name")} | public DNS name : #{instance.get("public-DNSname")} | root device name : #{instance.get("root-device-name")} | root device type : #{instance.get("root-device-type")} | launch time : #{instance.get("launch-time")} | subnet id : #{instance.get("subnet-id")} | virtualization type : #{instance.get("virtualization-type")} | vpc id : #{instance.get("vpc-id")} | ami launch index : #{instance.get("ami-launch-index")} |")
end

 

list-instances

List Instance on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: listtrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
instance-listAmazon EC2 instance info set
Example
response = @call.connector("amazon-ec2")
                    .set("action","list-instances")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode               #Exit status code
response_message = response.message                 #Execution status messages

#Amazon EC2 Connector Response Parameters
instances_list=response.get("instance-list")        #List of Amazon EC2 instances

instances_list.each do |instance_id|
    @log.info("Amazon EC2 instance : #{instance_id.to_s}")
end

 

create-security-group

Create security group on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: create-security-grouptrue
group-nameSpecifies the name of the security group Valid values: alphanumeric characters, spaces, dashes, underscorestrue
group-descriptionSpecifies the description for the security group Valid values: alphanumeric characters, spaces, dashes, underscorestrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
group-idAmazon EC2 security group id
Example
response = @call.connector("amazon-ec2")
                    .set("action","create-security-group")
                    .set("region","us-east-1")
                    .set("group-name","flint-group")
                    .set("group-description","flint security group")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

#Amazon EC2 Connector Response Parameters
group_id = response.get("group-id")          #Group id of Amazon EC2 Security group 

 

security-group-add-rule

Add In-bound or out-bound  rule to already exist security group on AWS-EC2 from given details.

Request parameters
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: security-group-add-ruletrue
security-group-idSpecifies the ID of the security group.true
directionContains the direction of the rule, Valid values : inbound,outboundtrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)false
protocolSpecifies the protocol to add rule to security group on Amazon EC2true
ip-rangeSpecifies the IP Ranges to add rule to security group on Amazon EC2false
cidr-blockSpecifies the CIDR Block to add rule to security group on Amazon EC2false
from-portSpecifies the from port number to add rule to security group on Amazon EC2true
to-port

Specifies the to port number to add rule to security group on Amazon EC2

true
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example

 

response = @call.connector("amazon-ec2")
                .set("action","security-group-add-rule")
                .set("security-group-id","sg-01345279") 
                .set("region","us-east-1")
                .set("direction","inbound")
                .set("ip-range","0.0.0.0/0")
                .set("cidr-block","10.0.0.0/32")
                .set("from-port",0)
                .set("to-port",65535)
                .set("protocol","tcp")
                .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                .timeout(100000)
                .sync


#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

 

describe-security-group

Describe security group on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: describe-security-grouptrue
group-nameSpecifies the name of the security group Valid values: alphanumeric characters, spaces, dashes, underscorestrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
security-group-infoAmazon EC2 security group info
Example 
response = @call.connector("amazon-ec2")
                    .set("action","describe-security-group")
                    .set("region","us-east-1")
                    .set("group-name","flint-group")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode                    #Exit status code
response_message = response.message                      #Execution status messages

#Amazon EC2 Connector Response Parameters
security_group_info=response.get("security-group-info")  #Set of Amazon EC2 security groups details

security_group_info.each do |group_info|
    @log.info("Amazon EC2 Security group owner ID : #{group_info.get("owner-id")} | group name : #{group_info.get("group-name")} | group description : #{group_info.get("group-description")} | group vpc ID : #{group_info.get("vpc-id")} | group ID : #{group_info.get("group-id")} | group IP Permissions Egress : #{group_info.get("ip-permissions-egress")} | group Tags : #{group_info.get("tags")} | group IP Permissions : #{group_info.get("ip-permissions")} |")
end

 

delete-security-group

Delete security group on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: delete-security-grouptrue
group-nameSpecifies the name of the security group Valid values: alphanumeric characters, spaces, dashes, underscorestrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","delete-security-group")
                    .set("region","us-east-1")
                    .set("group-name","flint-group")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode                    #Exit status code
response_message = response.message                      #Execution status messages 

 

allocate-address

Allocate address on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: allocate-addresstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
public-ipAllocated Public IP of Amazon EC2
Example
response = @call.connector("amazon-ec2")
                    .set("action","allocate-address")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

#Amazon EC2 Connector Response Parameters
public_ip = response.get("public-ip")        #Allocated Public IP of Amazon EC2

 

release-address

Release address on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: release-addresstrue
public-ipSpecifies the IP address that you want to releasetrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example

 
response = @call.connector("amazon-ec2")
                    .set("action","release-address")
                    .set("public-ip","52.73.64.13")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

 

associate-address

Associate address on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: associate-addresstrue
public-ipSpecifies the IP address that you want to releasetrue
instance-idSpecifies the instance to associate with the IP addresstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","associate-address")
                    .set("instance-id","i-1a2b3cd")
                    .set("public-ip","52.73.64.13")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

disassociate-address

Disassociate address on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: disassociate-addresstrue
public-ipSpecifies the IP address that you want to Disassociatetrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","disassociate-address")
                    .set("public-ip","52.73.64.13")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages 

 

describe-addresses

Describe address on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: describe-addressestrue
public-ipSpecifies the IP address that you want to Describetrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
public-ips-setset of public IP of amazon EC2 account
Example
response = @call.connector("amazon-ec2")
                    .set("action","describe-addresses")
                    .set("public-ip","52.73.64.13")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode            #Exit status code
response_message = response.message              #Execution status messages

public_ips_set = response.get("public-ips-set")  #set of public IP of amazon EC2 account

 

create-tags

Create tags AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: create-tagstrue
resource-idSpecifies the id of resource to which you want to add tagstrue
tag-keySpecifies the tag key which you want to assigntrue
tag-valueSpecifies the tag value which you want to assigntrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","create-tags")
                    .set("resource-id","i-1a2b3cd")
                    .set("tag-key","name")
                    .set("tag-value","flint-vm")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode            #Exit status code
response_message = response.message              #Execution status messages

 

delete-tags

Delete tags on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: delete-tagstrue
resource-idSpecifies the id of resource from which you want to remove tagstrue
tag-keySpecifies the tag key which you want to removetrue
tag-valueSpecifies the tag value which you want to removetrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","delete-tags")
                    .set("resource-id","i-1a2b3cd")
                    .set("tag-key","name")
                    .set("tag-value","flint-vm")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode            #Exit status code
response_message = response.message              #Execution status messages

 

describe-tags

Describe tags on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: describe-tagstrue
resource-idSpecifies the id of resource from which you want to describe tagstrue
resource-typeSpecifies the resource type from which you want to describe tagstrue
tag-valueSpecifies the tag value which you want to removetrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
tag-setset of resource tags of amazon EC2 account
Example
response = @call.connector("amazon-ec2")
                    .set("action","describe-tags")
                    .set("resource-id","i-1a2b3cd")
                    .set("resource-type","instance")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode        #Exit status code
response_message = response.message          #Execution status messages

tags_set = response.get("tag-set")  #set of resource tags of amazon EC2 account 

create-snapshot

Create volume snapshot on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: create-snapshottrue
volume-idSpecifies the id of volume of which you want to create snapshottrue
descriptionSpecifies the description of snapshottrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
snapshot_id
Id of volume snapshot created in amazon EC2 account
description
Description of volume snapshot created in amazon EC2 account
owner_alias
Owner alias of volume snapshot created in amazon EC2 account
owner_id
Owner id of volume snapshot created in amazon EC2 account
progress
Progress of volume snapshot created in amazon EC2 account
volume_id
Volume id of volume snapshot created in amazon EC2 account
Example
response = @call.connector("amazon-ec2")
                    .set("action","create-snapshot")
                    .set("volume-id","vol-1a2b3cd")
                    .set("description","Test volume snapshot")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode            #Exit status code
response_message = response.message              #Execution status messages

snapshot_id = response.get("snapshot-id")  # Id of volume snapshot created in amazon EC2 account
description = response.get("description") # Description of volume snapshot created in amazon EC2 account
owner_alias = response.get("owner-alias") # Owner alias of volume snapshot created in amazon EC2 account
owner_id = response.get("owner-id") # Owner id of volume snapshot created in amazon EC2 account
progress = response.get("progress") # Progress of volume snapshot created in amazon EC2 account
state = response.get("state") # State of volume snapshot created in amazon EC2 account
volume_id = response.get("volume-id") # Volume id of volume snapshot created in amazon EC2 account

 

delete-snapshot

Delete volume snapshot on AWS-EC2 from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the AWS-EC2 Connector to be configured.true
actionContains the name of the operation: delete-snapshottrue
snapshot-idSpecifies the id of resource from which you want to remove tagstrue
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Example
response = @call.connector("amazon-ec2")
                    .set("action","delete-tags")
                    .set("snapshot-id","snap-1a2b3cd")
                    .set("region","us-east-1")
                    .set("security-key","i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev")
                    .set("access-key","BQBIJKQHGGHHGF3KL5SGQ")
                    .timeout(120000)
                    .sync

#Amazon EC2 Connector Response Meta Parameters
response_exitcode = response.exitcode            #Exit status code
response_message = response.message              #Execution status messages

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.
  puts "success"
  # take action in case of success
else                                    # non zero means fail
  puts "fail"
  puts "Reason:" + response.message     # get the reason of failure
  ## Take action in case of failure
end

 

 

 

connector_call = @call.connector(@connector_name)
 .set('action', @action)
 .set('tenant-id', @tenant_id)
 .set('subscription-id', @subscription_id)
 .set('key', @key)
 .set('client-id', @client_id)

On this page: