With Flint's AWS-EC2 Connector you can launch and manage server instances in Amazon data centers.

With this document, we will be able to use and work with the AWS-EC2 Connector.

Design Aspects

Perform all standard application operations like Instance, Security Group and Resource Tagging operations available through the Amazon EC2 web services. Some of them are listed below:

  • Create instance, security groups and resource tags
  • Describe instance, security groups and resource tags
  • Delete instance, security groups and resource tags
  • Stop instance
  • Terminate instance
  • Modify instance attributes Also,
  • The ability to set Connector execution timeouts
  • Synchronous / Asynchronous execution of the Connector

Connector Configuration

add_aws_ec2_connector

Configuration parameters
ParameterDescriptionRequired
access-keyAmazon Web Services account Access-key Credentialstrue: config/request
security-keyAmazon Web Services account Security-key Credentialstrue: config/request
Example
{
  "access-key": "BQBIJKQHGGHHGF3KL5SGQ",
  "security-key": "i2+pesMfdgfdgasdfqwegfdddfg6Qo+fgfdgeHKfdgdfgH0mev"
}

 

Actions

create-instance

Create 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: create-instancetrue
image-idSpecifies the unique ID for the AMI(Amazon Machine Images)true
instance-typeSpecifies the type of the instance Valid values are: m1.small, m1.large, m1.xlarge, c1.medium, c1.xlarge, m2.2xlarge, m2.4xlarge, t2.microtrue
min-instanceSpecifies the minimum number of instances to launch, If Amazon EC2 cannot launch the value specified in the (min-count) element, no instances are launched. Valid values: Any value between 1 and the maximum number of instances allowed for your Amazon EC2 accountfalse
max-instanceSpecifies the maximum number of instances to launch, If Amazon EC2 cannot launch the value specified in the (max-count) element, the largest possible number greater than that specified in the (min-count) element is launched. Valid values: Any value between 1 and the maximum number of instances allowed for your Amazon EC2 accounttrue
availability-zoneSpecifies the placement constraints or availability zones for launching the required instances For example, us-east-1a is a sample value for the availability zone element. (Default: us-east-1a)false
regionSpecifies the region for performing operations on Amazon EC2 (Default value: us-east-1)true
key-nameSpecifies the name of the key pairfalse
subnet-idSpecifies the subnet ID for the Amazon Virtual Private Cloud within which to launch the instance or instancesfalse
access-keySpecifies the credentials for signing the connector requestfalse
security-keySpecifies the credentials for signing the connector requestfalse
Response parameters
ParameterDescription
instance-infoAmazon EC2 created instance info set
Example
 
response = @call.connector("amazon-ec2")
                    .set("action","create-instance")
                    .set("image-id","ami-dc1c2b8e")
                    .set("instance-type","t2.micro")
                    .set("min-instance",1)
                    .set("max-instance",1)
                    .set("region","us-east-1")
                    .set("availability-zone","us-east-1a")
                    .set("key-name","flint-test")
                    .set("subnet-id","subnet-4d3c2b1a")
                    .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
instance_info = response.get("instance-info")           #Amazon EC2 created instance info set

instance_info.each do |instance|
    @log.info("Amazon EC2 Instance ID : #{instance.get("instance-id")} | Instance Type : #{instance.get("instance-type")} | Instance public IP : #{instance.get("public-ip")} | Instance private IP : #{instance.get("private-ip")} ") 
end 

 

 

start-instances

Start 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: start-instancestrue
instance-idContains one or more instance IDs corresponding to the instances that you want to start, 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
started-instances-setAmazon EC2 started instance info set
Example
 
response = @call.connector("amazon-ec2")
                    .set("action","start-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("started-instances-set")  #Set of Amazon EC2 started 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 

stop-instances

Stop 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: stop-instancestrue
instance-idContains one or more instance IDs corresponding to the instances that you want to stop, 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
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
allocation-idSpecifies the allocation-id of Elastic IP 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("allocation-id","eipalloc-45b86322")
                    .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

 

 

On this page: