Utility_Operations for the Amazon EC2 REST adapter

This section illustrates the adapter request and response for the Get Console Output Utility operation.

Get Console Output operation

The Get Console Output operation retrieves console output for a specified instance. 

The console output for an instance is buffered and posted after an instance is booted, rebooted, or terminated. Amazon EC2 preserves the most recent 64 KB output, which is available for at least one hour after the latest post to the console output.

The following figure shows the sample <items> XML element for the Get Console Output operation. 

Sample <items> XML element for the Get Console Output operation 

<items>
  <item>
    <parameters>
      <instance-id></instance-id>
    </parameters>
  </item>
</items>

The following table describes the adapter request elements for the Get Console Output operation. 

Adapter request elements for the Get Console Output operation 

Element

Definition

Required

<access-key>

Specifies the Amazon Web Services (AWS) access key

You need to generate the AWS access key by going to the Security Credentials tab in the AWS console.

Conditional;

  • You must specify the Access Key and theSecret Key together in the configuration or the adapter request.
  • If you specify both the keys in the adapter request and in the adapter configuration, the key values in the request override the values in the configuration.
  • If only the Access Key is specified, the adapter ignores the value.
<secret-key>

Specifies the AWS secret access key

You need to generate the AWS secret access key by going to the Security Credentials tab in the AWS console.

Conditional;

  • You must specify the Access Key and theSecret Key together in the configuration or the adapter request.
  • If you specify both the keys in the adapter request and in the adapter configuration, the key values in the request override the values in the configuration.
  • If only the Secret Access Key is specified, the adapter ignores the value.
<region>

Specifies the region with which you want the adapter to communicate

Amazon EC2 is hosted in multiple locations world-wide. You must specify the region in which you want the adapter to perform the actions.

Valid values:

  • us-east-1
  • us-west-2 (default)
  • us-west-1
  • eu-west-1
  • ap-southeast-1
  • ap-northeast-1
  • ap-southeast-2
  • sa-east-1
No

<operation-name>

Contains the name of the operation: get-console-output

Yes

<instance-id>

Specifies the ID of the instance for which you want console output

Yes

The following figure shows a sample adapter request for the Get Console Output operation. 

Sample adapter request for the Get Console Output operation 

<amazon-ec2-rest-request>
    <operation-name>get-console-output</operation-name>    
    <access-key>AKIA**********N8BT2Q</access-key>
    <secret-key>WQisk8Irh********************8AiJx3VQVd</secret-key>
    <region>us-east-1</region>
    <parameters>
        <instance-id>i-1420b93a</instance-id>
    </parameters>
</amazon-ec2-rest-request>

The following figure shows the response for the sample adapter request for the Get Console Output operation. 

Sample adapter response for the Get Console Output operation 

<amazon-ec2-rest-response>
    <metadata>
        <status>success</status>
    </metadata>
    <GetConsoleOutputResponse>
        <instanceId>i-1420b93a</instanceId>
        <timestamp>Mon Feb 03 12:51:47 GMT+05:30 2014</timestamp>
        <output><![CDATA[Xen Minimal OS!
          start_info: 0xae2000(VA)
            nr_pages: 0x26700
          shared_inf: 0x7ed22000(MA)
             pt_base: 0xae5000(VA)
        nr_pt_frames: 0x9
            mfn_list: 0x9ae000(VA)
           mod_start: 0x0(VA)
             mod_len: 0
               flags: 0x0
            cmd_line: root=/dev/sda1 ro 4
          stack:      0x96d840-0x98d840
        MM: Init
              _text: 0x0(VA)
             _etext: 0x7dc7d(VA)
           _erodata: 0x9a000(VA)
             _edata: 0x9fce0(VA)
        stack start: 0x96d840(VA)
               _end: 0x9ade40(VA)
          start_pfn: af1
            max_pfn: 26700
        Mapping memory range 0xc00000 - 0x26700000
        setting 0x0-0x9a000 readonly
        skipped 0x1000
        MM: Initialise page allocator for c1f000(c1f000)-26700000(26700000)
        MM: done
        Demand map pfns at 26701000-2026701000.
        Heap resides at 2026702000-4026702000.
        Initialising timer interface
        Initialising console ... done.
        gnttab_table mapped at 0x26701000.
        Initialising scheduler
        Thread "Idle": pointer: 0x2026702050, stack: 0x26660000
        Thread "xenstore": pointer: 0x2026702800, stack: 0x26670000
        xenbus initialised on irq 1 mfn 0xe2c3e7
        Thread "shutdown": pointer: 0x2026702fb0, stack: 0x26680000
        Dummy main: start_info=0x98d940
        Thread "main": pointer: 0x2026703760, stack: 0x26690000
        "main" "root=/dev/sda1" "ro" "4"
        vbd 2049 is hd0
        ****************** BLKFRONT for device/vbd/2049 *********
        ...........................................................
        ...........................................................
        Starting atd: [  OK  ]
        Running cloud-init user-scripts (none found)[  OK  ]
        Amazon Linux AMI release 2013.09
        Kernel 3.4.73-64.112.amzn1.x86_64 on an x86_64
        ip-10-73-184-69 login: ]]>
        </output>
    </GetConsoleOutputResponse>
</amazon-ec2-rest-response>
Was this page helpful? Yes No Submitting... Thank you

Comments