Authentication

The Authentication REST APIs can be used by an external application to authenticate itself to the DCNM in order to control the Fabric Automation cluster. After calling logon to get the token, all the subsequent REST API requests need to set the DCNM-Token field with the token in the HTTPS header.

From Release 10.0(1), by default, the Cisco DCNM will support https only.

The following are the Authentication REST APIs:

Status

The following table details the API Response code, status and, the HTTPS methods.

Status Code
Status
API's HTTPS Method or
HTTPS Method

200

OK

GET

202

Accepted

POST

PUT

DELETE

400

Bad Request

GET

POST

PUT

DELETE

401

Unauthorized

GET

POST

PUT

DELETE

403

Forbidden

GET

POST

PUT

DELETE

404

Not Found

GET

POST

PUT

DELETE

405

Method Not Allowed

GET

POST

PUT

DELETE

500

Internal Server Error

GET

POST

PUT

DELETE

Logon

Resource Name

/logon

Description

Logon to DCNM server to authenticate the user. Once the authentication is complete, a token will be returned as the response. All API calls to the DCNM server should use this token until it is expired or invalid. The logon API uses “username:password” with base64 encoded in https Authorization header. For example, “Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==” will return the token in the payload.

https Method

POST

URL

https://dcnm-ip/rest/logon

Parameter

Parameter
Type
Description

expirationTime

O

Token expiry time in milliseconds.

Return Value

Format: JSON

Type: Object

Attribute Name
Type
Description

Dcnm-Token

S

Details of the token.

Logout

Resource Name

/logout

Description

Logout from the DCNM server. Once you have logged out, the token will be invalid. You must set the token in the Authorization header while using this API.

https Method

POST

URL

https://dcnm-ip/rest/logout

Parameter

Parameter
Type
Description

 

 

 

Return Value

Format: JSON

Type: Object

Attribute Name
Type
Description

 

 

 

Get DCNM Version

Resource Name

/rest/dcnm-version

Description

Get the installed DCNM version.

https Method

GET

URL

https://dcnm-ip/rest/dcnm-version

Parameter

Parameter
Type
Description

 

 

 

Return Value

Format: JSON

Type: Object

Attribute Name
Type
Description

Dcnm-Version

S

Get DCNM version.