The credentials API provides functionality that allows a administrator to add, delete or update credentials

Get all credentials

Lists all the credentials configured in the Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/credentials

Pagination query string parameters

Sorting query string parameters

Get all credentials, filtered

Lists credentials configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.

POST /aspire/_api/credentials/getAll

Pagination query string parameters

Sorting query string parameters

Filters: The credential filter definition here

Response

{
    "count": {
        "totalItems": 1
    },
    "credential": [
        {
            "id": "40b305ea-77e1-4874-aa28-964b1cf4a1a8",
            "type": "filesystem",
            "description": "xxxx",
            "throttlePolicy": "10653921-1b27-40b5-9d7a-f54ef1e3ad01",
            "properties": {
                "domain": "xxxx",
                "user": "xxxx",
                "password": "xxxx"
            }
        }
    ]
}

Status: 200




Get a single credential

Get information about a single credential configured in Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/credentials/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the credential to return


Response

{
    "credential": {
        "id": "40b305ea-77e1-4874-aa28-964b1cf4a1a8",
        "type": "filesystem",
        "description": "xxxx",
        "throttlePolicy": "10653921-1b27-40b5-9d7a-f54ef1e3ad01",
        "properties": {
            "domain": "xxxx",
            "user": "xxxx",
            "password": "xxxx"
        }
    }
}

Status: 200, 404




Add credential(s)

Adds credentials to Aspire, this endpoint need the ADMINISTRATOR role to be executed.

POST /aspire/_api/credentials


Body Parameters

NameTypeRequiredDescription
typestringRequiredThe type of credential to add
descriptionstringRequiredAn optional description of the credential
throttlePolicystringOptionalThe throttle policy id
propertiesstringRequiredCredential properties


Example

POST /aspire/_api/credentials
{
    "type": "filesystem",
    "description": "xxxx",
    "properties": {
        "domain": "xxxx",
        "user": "xxxx",
        "password": "xxxx"
    }
}


Response

{
    "credential": [
        {
            "id": "43d1a498-c672-46b7-902f-082222122481",
            "type": "filesystem",
            "description": "xxxx",
            "properties": {
                "domain": "xxxx",
                "user": "xxxx",
                "password": "xxxx"
            }
        }
    ]
}

See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors

Status: 201, 406




Update credential(s)

Update credentials in Aspire, this endpoint needs the ADMINISTRATOR role to be executed.

PUT /aspire/_api/credentials/:id

PUT /aspire/_api/credentials

Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the credential to update
descriptionstringxThe description of the credential
propertiesobjectxCredential properties
throttlePolicystringxThe throttle policy id

x - at least one field must be present

Example - update more credentials

PUT /aspire/_api/credentials
{
  "AAABcID5GBc=": {
    "id": "AAABcID5GBc=",
    "throttlePolicy": "10653921-1b27-40b5-9d7a-f54ef1e3ad01"
  },
  "AAABcID5GBd=": {
    "id": "AAABcID5GBd=",
    "properties": {
       "domain": "xxxx",
       "user": "xxxx",
       "password": "xxxx"
    }
  }
}


Response

{"credential":[{"updated":true,"id":"AAABcID5GBc="},{"updated":true,"id":"AAABcID5GBd="}]}

Status: 200, 404, 406


Update credentials, filtered

Update credentials configured in the Aspire, filtered by a specified criteria, this endpoint needs the  ADMINISTRATOR role to be executed.

PUT /aspire/_api/credentials/updateAll

Filters: The credential filter definition here

Update body parameter

{
  "update" : {
    "description" : "DESCRIPTION",
    "throttlePolicy" : "THROTTLE_POLICY_ID",
    "properties": {
      "user": "true",
      .....
    }
  }
}

Response

{
  "message": "update result response message"
}

Status: 200, 406




Delete credential(s)

Delete one or more connectors from Aspire, this endpoint need the ADMINISTRATOR role to be executed.

DELETE /aspire/_api/credentials/:id

DELETE /aspire/_api/credentials

POST /aspire/_api/credentials/delete


Path Parameters and Query parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the credential(s) to delete


Body Parameter

NameTypeRequiredDescription
idsstringRequiredThe identifier(s) of the credential(s) to delete


Examples

DELETE /aspire/_api/credentials/AAABcID5GBc

DELETE /aspire/_api/credentials?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/credentials/delete
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406


Delete multiple credentials, filtered

Delete multiple credentials from Aspire, filtered by a specified criteria, this endpoint need the ADMINISTRATOR role to be executed.

POST /aspire/_api/credentials/deleteAll

Filters: The credential filter definition here

Response

{
  "message": "delete result response message"
}

Status: 200




Export credentials(s)

Export one or more credential from Aspire, this endpoint needs at least the OPERATOR role to be executed.

GET /aspire/_api/credentials/export

GET /aspire/_api/credentials/export/:id

POST /aspire/_api/credentials/exportAll

Every configuration item has the option to export from the UI, using the single menu or by the bulk actions:

Something important that you need to know is that when you export a config item that depends on another, the export will contain also all the dependencies.

Take into consideration that components with resources loaded into elastic, will be exported, but the resource itself will not, so you will need to reupload the resource and go and select your resource in the component again.


Path Parameters and Query parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the credential(s) to export


Body Parameter

NameTypeRequiredDescription
idsstringRequiredThe identifier(s) of the credential(s) to export


Examples

GET /aspire/_api/credentials/export/AAABcID5GBc

DELETE /aspire/_api/credentials/export?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/credentials/export
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

{
  "export": {
    "credentials": {
      "credential": [
        {
          "id": "<credential_id>",
          "type": "rest-api",
          "description": "REST",
          "properties": {
            "type": "bearer",
            "query": {
              ...
            }
          }
        },
		...
      ]
    }
  }
}

Status: 200, 404, 406


Export multiple credentials, filtered

Export multiple credentials from Aspire, filtered by a specified criteria, this endpoint needs at least the OPERATOR role to be executed.

POST /aspire/_api/credentials/exportAll

Filters: The connection filter definition here

Response

{
  "export": {
    "credentials": {
      "credential": [
        {
          "id": "<credential_id>",
          "type": "rest-api",
          "description": "REST",
          "properties": {
            "type": "bearer",
            "query": {
              ...
            }
          }
        },
		...
      ]
    }
  }
}

Status: 200




Import

The import usage can be found here





Filters

Credential filter:

{ 
 "filter" : {
    "ids" : ["ID1", "ID2", "ID3", ...],
    "type" : "TYPE",
    "description" : "DESCRIPTION",
	"throttlePolicy" : "THROTTLE_POLICY_ID"
  }
}
  • No labels