Account Instance API

Account instances can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of account instances.

Base URL for Account Instance REST API

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}

Each function returns a JSON account instance object. The account instance object has these attributes:

AttributeTypeDescription
nameStringName of the account instance
instanceIdLongId of the account instance
isActiveBooleanA boolean that tracks whether or not the account instance is active
codeStringUnique code of the account instance
providerStringName of the account provider
descriptionStringDescription of the account instance
propertiesList<PropertyValuePojo>The properties associated with the account instance, determined by provider. More info on the contents of each PropertyValuePojo is included below

Each property contains the following:

AttributeTypeDescription
propertyNameStringKey name of the property
propertyValueStringValue of the property
credentialIdLongId of the credential associated with the property. Applicable only for encrypted properties

Back to Top


GET

There are two implementations of GET. One will find an account instance with the given Id and return the JSON representation of the account instance. The other will find a list of account instances matching the parameters supplied to it.

GET by ID

This GET service will find an account instance with the given Id and return the JSON representation of the object. 

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}/{id}

Request

Parameter

Type

Required

Description

id

URLYesURL parameter for the id of the account instance to get
accountTypeURLYesURL parameter for the type of account. Possible values: cloud

Example

If we had a cloud account instance in our database with an Id of 11101, we can run a GET request at the following URL:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/cloud/11101

and the GET request would return a JSON account instance object for that instance:

Account Instance GET Return JSON
{
        "name": "aws",
        "properties": [
            {
                "propertyName": "FDAWSACCT_ACCESS_KEY",
                "propertyValue": "AKIAYMDHK5KKYHRC47US",
                "credentialId": null
            },
            {
                "propertyName": "FDAWSACCT_SECRET_KEY",
                "propertyValue": "*****",
                "credentialId": 11501
            }
        ],
        "provider": "AWS",
        "description": "Example account",
        "instanceId": 11101,
        "code": "AWS",
        "isActive": true
}

Back to Top

GET (Using Query Parameters)

This GET service will return a list of account instances in the form of JSON objects based on the query parameters code, name, and provider.  account instances are only returned if they match all of the specified query parameters. If no query parameters are given, this request will return the entire list of account instances.

API URLs

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}?

Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters: 

instanceCode={instanceCode}

instanceName={instanceName}

provider={provider}

Examples:
To search by code only:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}?instanceCode={instanceCode}

To search by provider only:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}?provider={provider}

To search by code and name:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}?instanceCode={instanceCode}&instanceName={instanceName}

The query parameters are not case sensitive. Searching by instanceCode=CODE is the same as searching by instanceCode=code.

Request

Parameter

Type

Required

Description

instanceCode

URLNoThis is a URL query parameter for the code which is used to search the account instances.
instanceNameURLNoThis is a URL query parameter for the name which is used to search the account instances.
providerURLNoThis is a URL query parameter for the provider which is used to search the account instances.

Example

If we had 2 account instances in our database with AWS as provider, when we run a GET request at the following URL:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/cloud?provider=aws

The GET request would return the following JSON account instance object

Account Instance GET Return JSON
[
    {
        "name": "AWS New",
        "properties": [
            {
                "propertyName": "FDAWSACCT_ACCESS_KEY",
                "propertyValue": "AKIAYMDHK5KKYH5RC7US",
                "credentialId": null
            },
            {
                "propertyName": "FDAWSACCT_SECRET_KEY",
                "propertyValue": "*****",
                "credentialId": 11501
            }
        ],
        "provider": "AWS",
        "description": "1st cloud account",
        "instanceId": 20701,
        "code": "AWSNEW",
        "isActive": true
    },
    {
        "instanceId": 20809,
        "code": "AWSOLD",
        "name": "awsOld",
        "provider": "AWS",
        "description": "Former AWS account",
        "isActive": false,
        "properties": [
            {
                "propertyName": "FDAWSACCT_ACCESS_KEY",
                "propertyValue": "AR3OTNMDPY5KKYHC47US",
                "credentialId": null
            },
            {
                "propertyName": "FDAWSACCT_SECRET_KEY",
                "propertyValue": "*****",
                "credentialId": 11496
            }
        ]
    }
]

Back to Top


POST

This POST service will create a new account instance with the same attributes as the given JSON object.

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}

Request

AttributeRequiredTypeDescription
accountTypeYesURLURL parameter for the type of account. Possible values: cloud
nameYesStringName of the account instance
isActiveNoBooleanA boolean that tracks whether or not the account instance is active. Defaults to yes
codeYesStringUnique code of the account instance
providerYesStringName of the account provider
descriptionNoStringDescription of the account instance
propertiesYes*List<PropertyValuePojo>

The properties associated with the account instance, determined by provider. More info on the contents of each PropertyValuePojo is included below

*The required properties are determined by provider

Each property contains the following:

AttributeRequiredTypeDescription
propertyNameYesStringKey name of the property
propertyValueYes*String

Value of the property. Providing the property value for credentials in the local store will update the value, but is not allowed for any other credential store providers.

*Either propertyValue or credentialId is required for encrypted properties

credentialIdYes*Long

Id of the credential associated with the property. Applicable only for encrypted properties

*Either propertyValue or credentialId is required for encrypted properties

Example

If the POST request receives the following JSON account instance object at this URL: http://host:port/flexdeploy/rest/v1/topology/integrations/account/cloud

POST JSON
{
    "provider": "AWS",
    "name": "AWS Account",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
            "propertyValue": "secretKey"
        }
    ],
    "description": "Adding description with POST",
    "code": "AWSACCT",
    "isActive": true
}

The following account instance object will then be created as a new row in the database.

Environment Post Return JSON
{
    "instanceId": 74852,
	"provider": "AWS",
    "name": "AWS Account",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
            "propertyValue": "*****",
			"credentialId": 46482
        }
    ],
    "description": "Adding description with POST",
    "code": "AWSACCT",
    "isActive": true
}

Back to Top


PUT

This PUT service will update all attributes of an account instance with the given Id based on the attributes of a JSON object parameters.

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}/{id}

Request

AttributeRequiredTypeDescription
accountTypeYesURLURL parameter for the type of account. Possible values: cloud

id

YesURLURL parameter for the id of the account instance to update
nameYesStringName of the account instance
isActiveNoBooleanA boolean that tracks whether or not the account instance is active. Defaults to yes
codeYesStringUnique code of the account instance
descriptionNoStringDescription of the account instance
propertiesYes*List<PropertyValuePojo>

The properties associated with the account instance, determined by provider. More info on the contents of each PropertyValuePojo is included below

*The required properties are determined by provider

Each property contains the following:

AttributeRequiredTypeDescription
propertyNameYesStringKey name of the property
propertyValueYes*String

Value of the property. Providing the property value for credentials in the local store will update the value, but is not allowed for any other credential store providers.

*Either propertyValue or credentialId is required for encrypted properties

credentialIdYes*Long

Id of the credential associated with the property. Applicable only for encrypted properties

*Either propertyValue or credentialId is required for encrypted properties

Account provider cannot be modified for a PUT request.

Example

If we had an account instance in our database with the following attributes:

Account Instance PUT JSON
{
    "instanceId": 74852,
	"provider": "AWS",
    "name": "AWS Account",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
            "propertyValue": "*****",
			"credentialId": 46482
        }
    ],
    "description": "Adding description with POST",
    "code": "AWSACCT",
    "isActive": true
}

When we run a PUT request at the following URL:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/cloud/74852

And the PUT request receives the following JSON account instance object,

Account Instance PUT Receive JSON
{
    "name": "AWS Account former",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
			"credentialId": 46482
        }
    ],
    "description": "",
    "code": "AWSACCTFORMER",
    "isActive": false
}

The PUT request would then update the account instance with Id 74852 and return the following JSON account instance object:

Account Instance PUT Return JSON
{
    "instanceId": 74852,
    "name": "AWS Account former",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
			"propertyValue": "*****",
			"credentialId": 46482
        }
    ],
    "description": "",
    "code": "AWSACCTFORMER",
    "isActive": false
}

Back to Top


PATCH

This PATCH service will update an existing account instance with the information passed through a JSON object. If an attribute of the JSON is null, it will not be updated in the account instance.

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/account/{accountType}/{Id}

Request

AttributeRequiredTypeDescription
accountTypeYesURLURL parameter for the type of account. Possible values: cloud

id

YesURLURL parameter for the id of the account instance to patch
nameYesStringName of the account instance
isActiveNoBooleanA boolean that tracks whether or not the account instance is active. Defaults to yes
codeYesStringUnique code of the account instance
descriptionNoStringDescription of the account instance
propertiesYes*List<PropertyValuePojo>

The properties associated with the account instance, determined by provider. More info on the contents of each PropertyValuePojo is included below

*The required properties are determined by provider

Each property contains the following:

AttributeRequiredTypeDescription
propertyNameYesStringKey name of the property
propertyValueYes*String

Value of the property. Providing the property value for credentials in the local store will update the value, but is not allowed for any other credential store providers.

*Either propertyValue or credentialId is required for encrypted properties

credentialIdYes*Long

Id of the credential associated with the property. Applicable only for encrypted properties

*Either propertyValue or credentialId is required for encrypted properties

Account provider cannot be modified for a PUT request.

Example

If we had an account instance in our database with the following attributes:

Account Instance PATCH JSON
{
    "instanceId": 74852,
	"provider": "AWS",
    "name": "AWS Account",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "AKIAYMDHK5KKYHRC47US",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
            "propertyValue": "*****",
			"credentialId": 46482
        }
    ],
    "description": "",
    "code": "AWSACCT",
    "isActive": true
}

When we run a PATCH request at the following URL:

http://host:port/flexdeploy/rest/v1/topology/integrations/account/cloud/74852

And the PATCH request receives the following JSON account instance object,

Account Instance PATCH Receive JSON
{
   "description": "Adding a description with PATCH",
   "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "HTI8REL9GHDITE3QKDP5V",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
			"credentialId": 46482
        }
    ]
}

The PATCH request would then update the account instance with Id 74852 and return the following JSON account instance object:

Account Instance PATCH Return JSON
{
    "instanceId": 74852,
	"provider": "AWS",
    "name": "AWS Account",
    "properties": [
        {
            "propertyName": "FDAWSACCT_ACCESS_KEY",
            "propertyValue": "HTI8REL9GHDITE3QKDP5V",
            "credentialId": null
        },
		{
            "propertyName": "FDAWSACCT_SECRET_KEY",
            "propertyValue": "*****",
			"credentialId": 46482
        }
    ],
    "description": "Adding a description with PATCH",
    "code": "AWSACCT",
    "isActive": true
}

Back to Top



The following macros are not currently supported in the footer:
  • style