Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > Dashboard Users Guide > Design > Macros > Actions > Start or Stop a Server with a Macro

Start or Stop a Server with a Macro

Table of Contents

Note: Macros are available only in LCP. Macros have been deprecated and are not available in the Unified Cloud Platform.

Objective

To create a custom Macro that will start/stop a specific Server.

Table of Contents

Steps

Go to Design -> Macros.  Click the New button.

Next, select the "Create New" option. Then click Create to produce a blank macro where you can add your own code that will be executed when a macro is run.

screen-MacrosNew.png

 

Change the macro's name to be more descriptive of the macro's action.  First let's make a macro that will start a server.  Change the macro's name to "Start Server 'X'".

screen-MacrosCommand.png

Click the Commands tab so that you can add the macro's executable code.  Click the Edit link and paste the following code.  Use the following code to start and stop a server.  (If you are starting a server, remove the "stop server" code and vice-versa)

// replace the account id and the server id// var server_url = "https://my.rightscale.com/api/acct/[acct id]/servers/[server id]"
// for example, the account id is 6789// and I want to start a server that has id 12345, for examplevar server_url = "https://my.rightscale.com/api/acct/6789/servers/12345"
// start server start_server(server_url)
// stop server stop_server(server_url)

 

You will need to specify the following information for the server:

  • acct id - The unique identification number of the account.  The easiest way to determine your acct id, is to go to Settings -> Account.  The number at the end of the url is your acct id.
  • server id - The unique identification number of the server.

Post Tutorial Steps

Repeat the process to create another macro for stopping a Server.

You must to post a comment.
Last modified
09:41, 22 Jan 2014

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.