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 > Create Assets

Create Assets

Objective

Use Postman for creating 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
  • Set the X_API_VERSION URL parameter key value to 1.5
  • Basic understanding of how to List and Show Assets (often you will need to list or show some cloud assets before creating others).

Overview

Using Postman to create (HTTP POST) cloud assets is fairly 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 to 1.5:

  • Modify the base request URL (in accord with the online reference documentation)
  • Add URL params as needed
  • Make sure the method is set to POST (not GET or other method)
  • Click the Send button when ready

Notes

  • https://my.rightscale.com/api is common to all requests in the examples used.  (Your API endpoint could vary depending on your RightScale account.)  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.

Create a Deployment

URL Parameter Name Value
deployment[name] Postman Test Deployment
deployment[description]

Create Deployment using POSTman

  • Example URL POSTman constructs:

https://my.rightscale.com/api/deployments.xml?deployment[name]=Postman Test Deployment&deployment[description]=Create Deployment using POSTman

  • Click Send when ready.

 

POSTman should look similar to the following before you send the POST request.

 

In addition to the Status "201 Created", you can verify from the Dashboard as needed.  For example, from Manage > Deployments:

Clone a ServerTemplate

Clone a previously imported ServerTemplate so it can be customized for a specific use case by servers in your deployment.  The following example was used to clone an imported "ServerTemplate Database Manager for Microsoft SQL Server (13.5.1-LTS)".

  • Change the base URL to:

https://my.rightscale.com/api/server...28492001/clone

  • Note:  328492001 is the example ID of the imported ServerTemplate to clone.
  • Add URL paramaters.  Example URL parameter name/value pairs.
URL Parameter Name Value
server_template[name] Gregs Clone of DbMgr for MySQL
server_template[description] Clone of MySQL Server DbMgr 13.5 LTS
  • Example URL POSTman constructs:

https://my.rightscale.com/api/server...te[name]=Gregs Clone of DbMgr for MySQL&server_template[description]=Clone of MySQL Server DbMgr 13.5

  • Click Send when ready.

 

POSTman should look similar to the following before you send the POST request.

 

 

In addition to the Status "201 Created", you can verify from the Dashboard as needed.  For example, from Design > ServerTemplates:

Create a Server

Create a Server and add it to a previously created Deployment.  This is a rather lengthy example, and requires a basic understanding of the Dashboard and API, including how to use the API Online Reference Documentation.

Notes:

  • This assumes that several other cloud resources have previously been created and are available to your account.  For example, a ServerTemplate, Security Group, etc.)  To get specific resource IDs for your account, you can use the API (or in many instances the Dashboard URI).
  • The API endpoint and account used in this example uses the Unified Cloud Platform (UCP) not a legacy account and API endpoint shown in most API examples ("my.rightscale.com").  For more information see UCP.

 

Do the following to create your new Server:

  • Change the base URL to the following (your API endpoint may differ, depending what shard your account is on):
  • Add URL parameters.  Example URL parameter name/value pairs:
URL Parameter Name Value
server[name] Base Linux Server
server[description] Base Linux for POSTman plugin tests
server[deployment_href] /api/deployments/443920003
server[instance][cloud_href] /api/clouds/3                          ### Note:  3 = the static cloud ID for AWS US-West
server[instance][server_template_href] /api/server_templates/320217003
server[instance][multi_cloud_image_href] /api/multi_cloud_images/356113003
server[instance][instance_type_href] /api/clouds/3/instance_types/CSB9P9B0US5VA
server[instance][security_group_hrefs][] /api/clouds/3/security_groups/4NASQ1JLPLNM
  • Example URL POSTman constructs:
    • https://us-3.rightscale.com/api/serv...ver[name]=Base Linux Server&server[description]=Base Linux for POSTman plugin tests&server[deployment_href]=/api/deployments/443920003&server[instance][cloud_href]=/api/clouds/3&server[instance][server_template_href]=/api/server_templates/320217003&server[instance][multi_cloud_image_href]=/api/multi_cloud_images/356113003&server[instance][instance_type_href]=/api/clouds/3/instance_types/CSB9P9B0US5VA&server[instance][security_group_hrefs][]=/api/clouds/3/security_groups/4NASQ1JLPLNM
  • Click Send when ready

 

POSTman should look similar to the following before you send the POST request.

 

 

In addition to the Status "201 Created", you can verify from the Dashboard as needed.  For example, from Manage > Deployments > DeploymentName

 

Notes:

  • Browser address bar for Server creation in the Dashboard uses the same API endpoint as used in POSTman (us-3.rightscale.com)
  • Server parameters reflect what was specified in POSTMan (ST, Cloud, Instance Type, etc.)

Post Tutorial Steps

Use POSTman to interface with the RightScale API for other list, show or create operations you want to accomplish.

You must to post a comment.
Last modified
14:38, 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.