automating rackspace with one automation
Post on 13-Apr-2017
311 Views
Preview:
TRANSCRIPT
Automate the CloudNovember 2015
Rackspace & Web Services Agent
Jennifer Jinhong - @jennjin
3 Property of Automic Software. All rights reserved
Cloud InfrastructureManaged Service Provider
4 Property of Automic Software. All rights reserved
Authentication
5 Property of Automic Software. All rights reserved
• Every REST request against a Rackspace service requires the inclusion of a specific authorization token, supplied by the X-Auth-Token HTTP header. Token is obtained by using the Rackspace Cloud Identity service and supplying a valid user name and API access key.
• OpenStack Keystone Identity Service v2.0.
• Token expires after 24 hours, so needs to be refreshed
6 Property of Automic Software. All rights reserved
Token Connection
URL Endpoint:
https://identity.api.rackspacecloud.com/v2.0
* No Authentication needed – Passed in Token Job
7 Property of Automic Software. All rights reserved
Token Job – Request
Choose Token CONN Object
Method – POSTMedia Type – application/json
JSON request -
{
"auth": {
"RAX-KSKEY:apiKeyCredentials": {
"username” : "<your username>",
"apiKey": "<your api key>"
}
}
}
JSON formatted Response
9 Property of Automic Software. All rights reserved
Token Job – Response
Parse the Response Extract 2 values –
– Token ID
– Expiration
JSON request -
{ "access": {
"token": {
"id": "AAC-WX0LLUSAq9x2OZohFziPrpItMkvX1H7FfpGylD_dclSbOMvg0zpANzRkoiAg53VsBpTjhJlTNtQsoWaa9tTr-cpLPxL24p4ekHCKEjWNPg2Bn11uOpv09jEmJP9xmMVqZmjgARrWrQ", "expires": "2015-09-24T19:04:11.635Z", "tenant": {
"id": "651772", "name": "651772" },
…....
10 Property of Automic Software. All rights reserved
Save token to Variable
Token ExpirationUsername
11 Property of Automic Software. All rights reserved
Authentication is passed in through the X-Auth-Token Header parameter of each request
INC will need to be added to the Pre Process Tab of each job
Create Include (INC) Object to pull the Token for each call
12 Property of Automic Software. All rights reserved
Cloud Storage
13 Property of Automic Software. All rights reserved
Connection Object – Cloud Files
Endpoints for the different Regions are in the Response from the Token call.Look for the section in the Token Response showing :
JSON formatted Response
14 Property of Automic Software. All rights reserved
Since each Region is a separate Endpoint, a Connection (CONN) object should be created for each Region used.
https://developer.rackspace.com/docs/cloud-files/v1/developer-guide/#document-api-reference
15 Property of Automic Software. All rights reserved
List Container
Choose CONN Object
Resource – /&container#Method – GET
Headers X-Auth-Token – &token_id#
Query Parametersformat - xml
16 Property of Automic Software. All rights reserved
Upload Files
Headers X-Auth-Token – &token_id#
Resource – /&container#Method – POST
Media Type – text/plain
Choose File - <file located on Agent’s Server>
17 Property of Automic Software. All rights reserved
Cloud Database
18 Property of Automic Software. All rights reserved
Region Endpoint
Chicago (ORD) https://ord.databases.api.rackspacecloud.com/v1.0/<account number>/
Dallas/Ft. Worth (DFW) https://dfw.databases.api.rackspacecloud.com/v1.0/<account number>
Northern Virginia (IAD) https://iad.databases.api.rackspacecloud.com/v1.0/<account number>/
London (LON) https://lon.databases.api.rackspacecloud.com/v1.0/<account number>/
Sydney (SYD) https://syd.databases.api.rackspacecloud.com/v1.0/<account number>/
Hong Kong (HKG) https://hkg.databases.api.rackspacecloud.com/v1.0/<account number>/
Endpoints – Cloud Database
19 Property of Automic Software. All rights reserved
20 Property of Automic Software. All rights reserved
List Instances
21 Property of Automic Software. All rights reserved
Response ResultJSON Formatted
22 Property of Automic Software. All rights reserved
Create Backup
JSON request -
{
"backup":{
"name" : "<name for backup>",
"description" : "<description for backup>",
"instance" : "<instance id>"
}
}
23 Property of Automic Software. All rights reserved
List Backups
24 Property of Automic Software. All rights reserved
Response ResultJSON Formatted
25 Property of Automic Software. All rights reserved
marketplace.automic.com
26 Property of Automic Software. All rights reserved
• General User Guide– https://developer.rackspace.com/docs/user-guides/infrastructure/
• Get Authentication Token– https://developer.rackspace.com/docs/cloud-servers/v2/developer-guide/#
document-general-api/authentication
• Cloud Files Actions– https://developer.rackspace.com/docs/user-guides/infrastructure/cloud-config/storage/cloud-files-pro
duct-actions/#cloud-files-product-actions
• Cloud Database API Reference– https://developer.rackspace.com/docs/cloud-databases/v1/developer-guide/#document-api-
reference
Rackspace Reference Docs
27 Property of Automic Software. All rights reserved
Done… Questions?
top related