Top Banner
41

Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Aug 04, 2018

Download

Documents

phungdat
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM
Page 2: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Hybrid Cloud Automation using Cisco CloudCenter API

Ray Doerr, Advanced Services Engineer

DEVNET-1651

Page 3: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Cisco Spark

Questions? Use Cisco Spark to communicate with the speaker after the session

1. Find this session in the Cisco Live Mobile App

2. Click “Join the Discussion”

3. Install Spark or go directly to the space

4. Enter messages/questions in the space

How

cs.co/ciscolivebot#DEVNET-1651

Page 4: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

• CloudCenter Overview

• Introduction to REST API for CloudCenter

• CloudCenter automation - User and Tenant creation

• Private/Public Cloud Virtual Machine Deployment and Demo

• VMware

• OpenStack

• AWS (Amazon Web Services)

• Microsoft AzureRM

• Conclusion

Agenda

Page 5: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 5DEVNET-1651

One REST-API script, Multiple Cloud Endpoints

CloudCenter

Page 6: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

CloudCenter Overview

Page 7: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Hybrid Cloud Management with CloudCenter

Single Integrated Management Platform

Full Application Lifecycle Management

Portable Scalable Secure

Private Clouds

Datacenters

Public Clouds

Model

Manage

Deploy

DEVNET-1651 7

Page 8: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Deploy

Manage

Model

HooksScripts

Events

SecuritySSO

HSM

InfrastructureIPAM

DNS

Docker

Puppet, Chef

Components

User Content

Vendor Content

Content Integration

Tool Integration

Extendable

Cloud APIsDatacenter Private and

Public Cloud

Platform IntegrationITSM | Build Automation (Jenkins)

Secure

Multi-tenant

Extendable

Scalable

DEVNET-1651 8

Page 9: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Application Profile Graphical Modeler

“One Click” Deploy

Page 10: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Multi-Cloud Application Deployment

CloudCenter Manager Application Profile

Public

Cloud

Public

Cloud

Private

Cloud

Multi-Tier ApplicationMulti-Cloud Deployment

Page 11: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Introduction to REST API for CloudCenter

Page 12: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 12DEVNET-1651

API Overview

• CloudCenter API Version 1.0 (v1) - supports CloudCenter 3.x & 4.x

• CloudCenter API Version 2.0 (v2) - supports CloudCenter 4.6.0 and greater

• Structured responses with minimum details, provides resource links

• Improved search, sort and pagination filters

• Governance is referenced using tagIds, deployments are referenced using depEnvId, and so forth. Similarly, all other resources are referenced using the corresponding ID

• Documentation located at http://docs.cloudcenter.cisco.com/ under API

CloudCenter uses the REST API conventions below

Page 13: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 13DEVNET-1651

REST-API

• REST-API method (GET, POST, PUT and DELETE)

• REST-API URL consisting of:

• IP Address or Hostname of CloudCenter CCM or Load Balancer

• TCP Port that CloudCenter is listening on, defaults to 443

• REST-API resource, example: v1/users

• API Credentials (details on next slide)

• Username

• API Key

• Request Body (not required for all REST-API calls)

• JSON Data

Required Information

Page 14: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 14DEVNET-1651

REST-API

curl -k -X GET -H "Accept: application/json” –u cloudCenteradmin:40E45DBE57E35ECB "https://10.1.1.11:443/v1/users”

Example using curl

Or use you favorite application like Postman

Page 15: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 15DEVNET-1651

API Credentials

• Select Admin->Users from the menu

• Click on “Manage API Key” for the User you want to use for API access

• From this window you should see the User Name and Key that will be required for API Access. Note: The User Name is generated by the system and not your Email address.

• You can also generate a new API Key from this window if required.

From CloudCenter GUI:

Page 16: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 16DEVNET-1651

API Credentials

• This is the Username and Key you will use for REST API calls

(continued)

Page 17: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Functional Groups of REST API’s

• User Management. Create/View/Update and Delete.

• Group Management. Create/View/Update and Delete.

• Tenant Management. Create/View/Update and Delete.

• Job Management, both v1 and v2. List/Submit/Stop/Resume/Suspend, etc.

• Application Management. List, Get, Delete, Export, Update(name, description and version only).

• Service Management. Create/View/Update and Delete.

• Cloud Management. Cloud Accounts, Cloud Regions, Image Mapping, Cloud Storage, etc.

• Deployment Environment. Create/View/Update and Delete.

• Inventory Management. List VM’s, Power On/Off or Reboot/Terminate VMs.

• Policy Management. Create/Enable/View/Update and Delete.

• Report Management, both v1 and v2

17DEVNET-1651

Page 18: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

API Access using Python’s Request Module

18DEVNET-1651

Page 19: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

JSON Output of Python Script

19DEVNET-1651

Page 20: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

CloudCenter Automation- User and Tenant Creation

Page 21: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 21DEVNET-1651

User Creation

• Create User without Activation requires:

• Authentication Credentials of Tenant Admin

• tenantId of Tenant Admin where this user will be created

URL: /v1/users

Page 22: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 22DEVNET-1651

User Creation and Activation

• Create User with Activations requires:

• planId of Usage Plan to assign to this User

• contractId of Contact to assign to this User

• activateRegions, Array of regionId’s to assign to this User

URL: /v1/users

Page 23: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 23DEVNET-1651

Tenant Creation

• userId is for the User that will be granted Tenant Admin for this new Tenant

• shortName is the Tenant ID you use for CloudCenter GUI login

User must already be created

Page 24: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Private/Public Cloud Virtual Machine Deployments

Page 25: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 25DEVNET-1651

Creating a Deployment

Users

CloudsRegions

Applicati

on

Environ

ment

Policy

Page 26: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 26DEVNET-1651

Get Applications

• Returns a list of Applications with Resource URL.

URL: /v1/apps

Page 27: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 27DEVNET-1651

Get Application

• Gather the “id”, “metadatas” and “version”

• Collect the ”id” from serviceTiers list

• For each ServiceTier gather the Supported Clouds

URL: /v1/apps/<app-id>?version=x.y

Page 28: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 28DEVNET-1651

Get Environments

• Gather the Environment “id”

• Gather ”regionId”, cloudAccountId” and “basicSettings” from the “associatedClouds” section

URL: /v1/environments

Page 29: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 29DEVNET-1651

Get Supported Clouds InformationURL: /v1/apps/<app-id>/cloudConfigs/<cloud-id>

• InstanceType

• numOfCPUs

• memorySize

• localStorageSize

Page 30: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 30DEVNET-1651

Get Supported Clouds Information

• URL: /v1/apps/<app-id>/cloudConfigs/<cloud-id>

• Gather the Instance details (VMware, OpenStack and AWS shown below)

Page 31: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 31DEVNET-1651

VM Deployment

• Values that change per Cloud Endpoint are:

• environmentId

• cloudRegionId

• accountId

• instanceType

Common section of REST-API body for all Cloud Endpoints.

Page 32: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 32DEVNET-1651

VM DeploymentJobs section of REST-API body, list to support MultiTier Apps

Page 33: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 33DEVNET-1651

VM Deployment

• Here you can see the Parent Job with a single Child Job, since this was a single Tier application deployment

• Each Child Job will return the Resource URL that you can use to pool the status of that job.

Response

Page 34: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 34DEVNET-1651

Polling Deployment StatusJob Status – Polling both Parent and Child Jobs

Job Submitted Job Completed

Page 35: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Demo

• CloudCenter Application Profile deployment using REST API

• Deploy to Private/Public Clouds

• VMware

• OpenStack

• AWS (Amazon Web Services)

• Microsoft AzureRM

Page 36: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 36DEVNET-1651

One REST-API script, Multiple Cloud Endpoints

CloudCenter

Page 37: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Cisco Spark

Questions? Use Cisco Spark to communicate with the speaker after the session

1. Find this session in the Cisco Live Mobile App

2. Click “Join the Discussion”

3. Install Spark or go directly to the space

4. Enter messages/questions in the space

How

cs.co/ciscolivebot#DEVNET-1651

Page 38: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

• Please complete your Online Session Evaluations after each session

• Complete 4 Session Evaluations & the Overall Conference Evaluation (available from Thursday) to receive your Cisco Live T-shirt

• All surveys can be completed via the Cisco Live Mobile App or the Communication Stations

Don’t forget: Cisco Live sessions will be available for viewing on-demand after the event at CiscoLive.com/Online.

Complete Your Online Session Evaluation

Page 39: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Continue Your Education

• Demos in the Cisco campus

• Walk-in Self-Paced Labs

• Tech Circle

• Meet the Engineer 1:1 meetings

• Related sessions

39DEVNET-1651

Page 40: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM

Thank you

Page 41: Hybrid Cloud Automation using Cisco CloudCenter API · Hybrid Cloud Automation ... Integration Extendable Cloud APIs Datacenter Private and Public Cloud Platform Integration ITSM