Authentication

The Authentication REST APIs can be used by an external application to authenticate itself to the DCNM in order to programmatically control the Unified Fabric 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.

By default, the dcnm will support http. For https support, you need to run the command "appmgr update dcnm -h true”.

The following are the Authentication REST APIs:

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

S

Token expiry duration.

Return Value

Format: JSON

Type: Object

Attribute Name
Type
Description

Dcnm-Token

S

Details of the token.

Status Code

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

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

 

 

 

Status Code

202

Accepted

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

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.

Status Code

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error