Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > RightScale API 1.5 > Appendix A - APEye Tools > Google Chrome Postman Plugin > List and Show Assets

List and Show Assets

Objective

Use Postman for quick and simple listing of various cloud assets.  Specify response in either JSON (default) or XML format.

Table of Contents

Prerequisites

The following are prerequisites for completing this tutorial:

  • Google Chrome with Postman plugin
  • RightScale user account
  • Authenticated previously with the RightScale API

Overview

Using Postman to list (HTTP GET) cloud assets is simple and quick.  No need to spin up servers, write a bash, Ruby or PowerShell script, etc.  Basically, all you need to do is:

Steps

Having previously authenticated and set the X_API_VERSION HTTP header, modify the request URL and click the Send button.

Notes

  • https://my.rightscale.com/api is common to all requests.  Consider it a prefix for all API request URLs.
  • JSON is the default response format.  Add a ".xml" suffix to the URL for XML format.
  • List asset - The "Index" for a given resource in the online reference documentation. For example, List Security Groups.
  • Show asset - Shows just the specified asset.  For example, show just Security Group "4567"
  • List (index) and Show are always HTTP GET methods.

 

Cloud Asset to List or Show Request URL (HTTP GET)  (example IDs)
Account information https://my.rightscale.com/api/accounts/1234
Available Clouds https://my.rightscale.com/api/clouds
Instance Types for a specified cloud (e.g. GCE) https://my.rightscale.com/api/clouds/2175/instance_types
List specifications for a specific Instance Type (ID retrieved via API) https://my.rightscale.com/api/clouds/2175/instance_types/7F3E5V67F4V4C
List all Security Groups on AWS US-West (Cloud ID = 3) for an account on US-3 shard (note the different API endpoint in the Request URL) https://us-3.rightscale.com/api/clouds/3/security_groups

A basic pattern should be emerging as you learn how to fish for information from the RightScale API.

  • Lookup URL format in the online reference documentation
  • List information for a given resource
    • Note: Cloud resource info (Cloud > CloudName > CloudResource) must be obtained from the API, it cannot be teased out of the URL in the Dashboard.
  • Show information for a specific resource (usually obtained from the API, but sometimes from the Dashboard itself)

 

As an example... suppose you want to show information about a specific Security Group, not any of the resources from the table above.  You could:

 

Online reference information including a sample JSON response for Show Security Groups.

screen-API1_5 SecGroupShow-v1.png

 

 

 

Sample Postman Configuration

 

Sample response (JSON)

{
    "links": [
        {
            "rel": "self",
            "href": "/api/clouds/2175/security_groups/DTE14QTCF4QBO"
        },
        {
            "rel": "cloud",
            "href": "/api/clouds/2175"
        },
        {
            "rel": "security_group_rules",
            "href": "/api/clouds/2175/security_groups/DTE14QTCF4QBO/security_group_rules"
        }
    ],
    "description": "",
    "actions": [],
    "name": "ap-sg-1",
    "resource_uid": "sg-1c76421a7"
}

 

Sample response (XML)

<?xml version="1.0" encoding="UTF-8"?>
<security_group>
    <links>
        <link rel="self" href="/api/clouds/2175/security_groups/DTE14QTCF4QBO"/>
        <link rel="cloud" href="/api/clouds/2175"/>
        <link rel="security_group_rules" href="/api/clouds/2175/security_groups/DTE14QTCF4QBO/security_group_rules"/>
    </links>
    <description></description>
    <actions></actions>
    <name>ap-sg-1</name>
    <resource_uid>sg-1c76421a7</resource_uid>
</security_group>

Post Tutorial Steps

Use Postman for other list, show or other RightScale API operations you need to accomplish.

See also

You must to post a comment.
Last modified
14:40, 18 Dec 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.