ESC REST API - Cisco

2y ago
63 Views
1 Downloads
771.13 KB
42 Pages
Last View : 8d ago
Last Download : 1y ago
Upload by : Joanna Keil
Transcription

ESC REST APIESC REST Northbound API DocumentationTable of ContentsResources managed by ESC RESTBehavior of ESC REST operationsESC REST API Headers/Path/Body ParametersCallbacksMedia TypeInternal IDsBodyString Restrictions in Body/Internal IDsREST API SecurityREST AuthenticationREST Https SupportREST API ListResources managed by ESC oymentsBehavior of ESC REST operationsGET operations are synchronous the request/response parameters are described with an example of a request/responsePOST, DELETE, and PUT operations are asynchronous. The asynchronous design use the “web hooks” approach using two independent "oneway" invocations - one to start a long-running operation (Client to ESC) and the other one to notify a requester that it is completed (ESC to client)ESC REST API Headers/Path/Body ParametersCallbacksOne of the header parameters of the operation request will contain a callback field, whose value is a URI where the client expects a callback. Ifthis field is not present, no callback will be performed.When the operation has completed (either successfully or unsuccessfully), ESC will perform a POST request to the callback URI, with an entitybody containing the resource for this operation. The status will be returned in the HTTP header called esc-status-code and the status messagewill be returned in the HTTP header called esc-status-message.ESC Clients can match a completion report back to the original request by comparing the value of the HTTP header called esc-transaction-id tothe one returned in the initial status response.ESC Clients are expected to provide a REST implementation for all the callbacks.Media TypeAll POST, DELETE, and PUT operations that require request and/or response body must provide a header parameter for media type. Note, thatESC is currently tested to accept and return XML.Internal IDsIn some of the ESC REST API, there is a path parameter called "* internal id" where the asterisk is replaced by the resource type. ESC Clientsmust provide an internal id for its resource it wants to create. The internal ids are enforced so the ESC Clients are able to refer to them in futureoperations such as GET, PUT, or DELETE requests.It is recommended that the ESC Client generated internal ids within the scope of the ESC.NOTE: Reusing (recycling) of internal ids is not recommended. This practice can lead to confusion in trouble shooting.

BodyIn some of the POST, PUT, and DELETE requests you are required to provide a JSON/XML body. Depending on the resource, you will need toprovide certain fields in the body to successfully execute a request. Check the body section for each API (bottom of page) to see what fields aresupported.String Restrictions in Body/Internal IDsBodySome string parameters/fields, such as id, name, are restricted by the underlying cloud provider, such as Openstack. The allowable range forthese parameters is included in the Create section for each resource, in this notation: String minimum-length . . maximum length, for example,for Tenant name: String 1 . . 64Generally, names are either 1.64 (for Tenant/User) or 1.255 (for Network/Subnet/Flavor/Image/VM).Internal IDIds are restricted to 72 characters such as internal id 1.72 and external id 1.72.Internal id naming must conform the standards stated in RFC 3986 Uniform Resource Identifier (URI): Generic Syntax. See sections related toURI encoding, sections 2.2 Reserved Characters and 2.3 Unreserved Characters. ESC will accept an internal id specified in the request URLform the unreserved character set: unreserved ALPHA / DIGIT / "-" / "." / " ”NOTE: the tilde “ ” is not supported in the internal id character set.The internal id received in a request must be unique within the scope of all the domain resources (tenant, network, subnet, service catalog,deployment ) For example, you cannot create 2 networks with the same internal network id, even if the networks are created under differenttenants.REST API SecurityREST AuthenticationOverviewESC REST API uses http basic access authentication where the ESC client will have to provide a username and password when making ESCREST requests. The user name and password will be encoded with Base64 in transit, but not encrypted or hashed. HTTPS will be used inconjunction with Basic Authentication to provide the encryption.SetupBy default, the REST authentication is disabled. To enable it the pass the argument --enable-auth to ESC bootvm.py, ESC installation script.Username and PasswordThe REST interface has only one default username/password (admin credentials).The REST password can be updated using escadm tool from the ESC VM CLI: escadm rest set --username admin --password test123The REST password can be reset using escadm tool from the ESC VM CLI: escadm rest setYou can also update the password through the REST API:http://[ESCVM userName yourUsername&password yourPasswordSending an Authorized RequestTo send an authorized request an ESC client should send the request with the following header:Authorization: Basic hashed-pass where is the Base64 enconded string of the default username/passwordMost libraries and web clients have an interface for simply providing the username/password and the app will encode the username/passwordand add the HTTP Basic Auth header.Example using the default admin credentials:http://[ESCVM eAuthorizationREST Https Supportapplication/xmlBasic hashed-pass

OverviewESC supports https communication over port 8443. ESC will generate a self-signed certificate that the client will need to trust to get the httpscommunication going.SetupBy default, the REST https is disabled and restricted to localhost. To enable it pass the argument --enable-https-rest to ESC bootvm.py, ESCinstallation script.HA ConsiderationsIn an HA setup every ESC HA VM will have its own self-signed generated certificate. Upon an HA switchover, ESC north bound client will berequired to re-accept the new certificate it will be served.REST API List01-Tenants : Manage ESC tenants/v0/tenantsGETGet all tenantsImplementation NotesAll tenants in ESC will be returned as a ListResponse Class (Status 200)Model Model Schema[{"internal tenant id": "string","external tenant id": "string","name": "string","enabled": true,"vim mapping": true,"extensions": {"extension": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]},"containers": {"container": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]}}]}}]},"event type": "CREATE TENANT","managed resource": true}]Response Content TypeTry it out!application/xml

/v0/tenants/{internal tenant id}Implementation NotesDelete a tenant from ESCDELETEDelete a tenant from ESCParametersParameterValueDescriptionParameter Type Data TypeCallback(required)Callback URL for ESCnotificationsheaderstringinternal tenant id(required)Internal tenant ID (maxlength 72 characters)pathstringResponse MessagesHTTP Status CodeReason200Tenant deletion request accepted400Invalid Request404Invalid Tenant IdResponse ModelHeadersTry it out!/v0/tenants/{internal tenant id}GETGet a tenant by its nameImplementation NotesOnly tenants created using ESC will be r Type Data Typeinternal tenant id(required)Internal tenant ID (maxlength 72 characters)pathstringResponse MessagesHTTP Status CodeReason200Get request accepted404Invalid Request - Invalid Tenant IDResponse ModelHeadersTry it out!/v0/tenants/{internal tenant id}POSTImplementation NotesCreates a tenant which will be managed by ESC and can be used for creating other resources under it.Example request:POST /v0/tenants/tentest HTTP/1.1Content-Type: application/xmlAccept: application/xmlCallback: http://127.0.0.1:9010/Body: tenant xmlns "urn:ietf:params:xml:ns:netconf:base:1.0" name example-tenant /name managed resource true /managed resource /tenant After the tenant creation operation is done, ECS will send a callback to the client with the result. Example callback:HTTP/1.1 201 OKContent-Type: application/xml; charset UTF-8ESC TRANSACTION ID: e: 200ESC-Status-Message: Tenant successfully created tenant xmlns "urn:ietf:params:xml:ns:netconf:base:1.0" enabled true /enabled event type CREATE TENANT /event type external tenant id 484c620285ea4f588227ff3396215980 /external tenant id internal tenant id tentest /internal tenant id name example-tenant /name Create a tenant in ESC

managed resource true /managed resource /tenant ta Typebody(required)Tenant configurationpayloadbodyModel Model Schema{"internal tenant id": "string","external tenant id": "string","name": "string",Parameter content type:"enabled": true,application/xml"vim mapping": true,"extensions": {"extension": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]},"containers": {"container": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]}}]}}]},"event type": "CREATE TENANT","managed resource": true}Click to set as parameter valueCallback(required)Callback URL forESC notificationsheaderstringinternal tenant id(required)Internal tenant ID(max length 72characters)pathstringResponse MessagesHTTP Status CodeReason200Tenant creation request accepted400Invalid Request409Conflicting RequestResponse ModelHeadersTry it out!PUT/v0/tenants/{internal tenant id}Update a tenant from ESCImplementation NotesUpdate a tenant from eData Type

ParameterValueDescriptionParameterTypeData Typebody(required)Tenant payloadbodyModel Model Schema{"internal tenant id": "string","external tenant id": "string","name": "string",Parameter content type:"enabled": true,application/xml"vim mapping": true,"extensions": {"extension": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]},"containers": {"container": [{"name": "string","properties": {"property": [{"name": "string","value": "string","encrypted value": "string"}]}}]}}]},"event type": "CREATE TENANT","managed resource": true}Click to set as parameter valueCallback(required)Callback URL forESC notificationsheaderinternal tenant id(required)Internal tenant ID(max length 72characters)pathstringstringResponse MessagesHTTP Status CodeReason200Tenant update request accepted400Invalid Request404Invalid Tenant Id500Internal Server ErrorResponse ModelHeadersTry it out!02-Networks : Manage ESC ernalNetworkId}Delete a network from an existing tenant in ESCImplementation NotesDelete a network from ESCParametersParameterValueDescriptionParameter Type Data TypeCallback(required)Callback URL for ESCheaderstring

ParameterValueDescriptionParameter Type Data al network ID (maxlength 72 ernal tenant ID of thenetwork (max length 72characters)pathstringResponse MessagesHTTP Status CodeReason200Request accepted400Invalid request500Internal server errorResponse ModelHeadersTry it tworkId}Get a network by its tenant and internal network IDImplementation NotesOnly networks created using ESC will be r Type Data TypeinternalTenantId(required)Internal tenant ID of thenetwork (max length Internal network ID (maxlength 72 characters)pathstringResponse MessagesHTTP Status CodeReason200Request accepted404Network Id not foundResponse ModelHeadersTry it etworkId}Create a network under an existing tenant in ESCImplementation NotesCreate a network in eData TypeCallback(required)Callback URL for red)Internal tenant ID of thenetwork (max length Internal network ID(max length 72characters)pathstringbody(required)Network configurationpayloadbodyModel Model Schema{"locator": {"vim id": "string",Parameter content type:application/xml"vim type": "OPENSTACK","vim project": "string","vim project id": "string",

ParameterValueDescriptionParameterTypeData Type"vim region": "string","vim vdc": "string"},"vimNetName": "string","internal tenant id": "string","internal network id": "string","internal deployment id": "string","name": "string","shared": true,"external tenant id": "string","tenant name": "string","external network id": "string","subnet": ["string"],"admin state up": true,"locators": {"switch name": "string","datacenter": "string"},"event type": "CREATE NETWORK","provider segmentation id": "string","router external": true,"provider physical network": "string","provider network type": "string","vlan id": 0,"switch name": "string","number of ports": 0}Click to set as parameter valueResponse MessagesHTTP Status CodeReason200Request accepted400Invalid request404Network Id not found409Conflicting request503Unable to query VIMResponse ModelHeadersTry it out!GET/v0/{internalTenantId}/networksGet all networks under a tenantImplementation NotesAll networks under that tenant in ESC will be returned as a ListParametersParameterValueDescriptionParameter TypeData TypeinternalTenantId(required)Internal tenant ID of thenetwork (max length 72characters)pathstringResponse MessagesHTTP Status CodeReason200Request acceptedResponse ModelHeadersTry it out!03-Subnets : Manage ESC nalSubnetId}Implementation NotesDelete a subnet from

REST API Security REST Authentication Overview ESC REST API uses http basic access authentication where the ESC client will have to provide a username and password when making ESC REST requests. The user name and password will be encoded with Base64 in transit, but not encrypted or hashed. HTTPS will be used in

Related Documents:

Cisco Nexus 1000V for VMware vSphere REST API Plug-in Configuration Guide, Release 5.x 13 Using the REST API Plug-in Increase max-port via REST. Cisco Nexus 1000V for VMware vSphere REST API Plug-in Configuration Guide, Release 5.x 14 Using the REST API Plug-in Feature History for Using the REST API Plug-in.

Cisco ASA 5505 Cisco ASA 5505SP Cisco ASA 5510 Cisco ASA 5510SP Cisco ASA 5520 Cisco ASA 5520 VPN Cisco ASA 5540 Cisco ASA 5540 VPN Premium Cisco ASA 5540 VPN Cisco ASA 5550 Cisco ASA 5580-20 Cisco ASA 5580-40 Cisco ASA 5585-X Cisco ASA w/ AIP-SSM Cisco ASA w/ CSC-SSM Cisco C7600 Ser

About This Manual 1-2 Print Area Calculation 1-3 PROGRAMMING CONCEPTS Programming Language 2-2 Selecting Protocol Codes 2-3 Using Basic 2-4 Print Position Commands 2-6 COMMAND CODE QUICK REFERENCE A: ESC A Start Label 3-2 ESC A Cut, Label 3-2 ESC a Cut, Job3-2 ESC B Cut, Last 3-2 ESC AO Auto Online 3-2 ESC A1 Media Size 3-2 ESC & Form .

Printer control ESC @ 1B 40 Initialize Graphics commands ESC * 1B 2A Select bit image ESC K 1B 4B 8-dot single-density bit image ESC L 1B 4C 8-dot double-density bit image ESC Y 1B 59 8-dot double-speed double-density bit image ESC Z 1B 5A 8-dot quadruple-density bit image Kanji commands FS Y 1C 59 Specify kanji size

Supported Devices - Cisco SiSi NetFlow supported Cisco devices Cisco Catalyst 3560 Cisco 800 Cisco 7200 Cisco Catalyst 3750 Cisco 1800 Cisco 7600 Cisco Catalyst 4500 Cisco 1900 Cisco 12000 Cisco Catalyst 6500 Cisco 2800 Cisco ASR se

Cisco Nexus 1000V Cisco Nexus 1010 Cisco Nexus 4000 Cisco MDS 9100 Series Cisco Nexus 5000 Cisco Nexus 2000 Cisco Nexus 6000 Cisco MDS 9250i Multiservice Switch Cisco MDS 9700 Series Cisco Nexus 7000/7700 Cisco Nexus 3500 and 3000 CISCO NX-OS: From Hypervisor to Core CISCO DCNM: Single

Cisco Nexus 7706 Cisco ASR1001 . Cisco ISR 4431 Cisco Firepower 1010 Cisco Firepower 1140 Cisco Firepower 2110 Cisco Firepower 2130 Cisco FMC 1600 Cisco MDS 91485 Cisco Catalyst 3750X Cisco Catalyst 3850 Cisco Catalyst 4507 Cisco 5500 Wireless Controllers Cisco Aironet Access Points .

and STM32F103xx advanced ARM-based 32-bit MCUs Introduction This reference manual targets application developers. It provides complete information on how to use the low-, medium- and high-density STM32F101xx, STM32F102xx and STM32F103xx microcontroller memory and peripherals. The low-, medium- and high-density STM32F101xx, STM32F102xx and STM32F103xx will be referred to as STM32F10xxx .