Bulk update keys of AWS cloud accounts

Bulk change the keys of AWS cloud accounts.

When 200 success response is received, the last account name in the list is given. When the 200 response contains failures (due to invalid key details) the result shows the first account in the list that fails (indicating that accounts listed before have been updated successfully).

Resource Name: /api/v1/firewallData/bulkUpdateCloudAccounts

Request Method: PUT

Request Parameters:

Element

Type

Description

AccountDetails Array of Account Details objects containing:  
accessKeyId
Mandatory

String

Access Key ID

accountName
Mandatory

String

Account Name

secretAccessKey
Mandatory

String

Secret Access Key

cloudAccountType

optional

String Cloud Account Type. Currently will default to AWS.

Response:

Code

Description

200

OK

400

Validation error

401

Unauthorized

Request cURL example

localhost/afa/api/v1/firewallData/bulkUpdateCloudAccounts" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"accountDetails\": [ { \"accessKeyId\": \"string\", \"accountName\": \"string\", \"secretAccessKey\": \"string\" } ], \"cloudAccountType\": \"AWS\"}"

Request JSON example

curl --location --request PUT 'http://localhost:8080/afa//firewallData/bulkUpdateCloudAccounts' \
--header 'Content-Type: application/json' \
--data '{   "accountDetails": [
{
"accountName": "aws-test",
"accessKeyId": "<access_key>",
"secretAccessKey": "<secret_key>"     },
{
"accountName": "aws-test1",
"accessKeyId": "<access_key1>",
"secretAccessKey": "<secret_key2>"     }
],
"cloudAccountType": "AWS" }'

200 Response: Updated successfully

Copy
{
"successfullyUpdatedAccounts" : [ {
"accountName" : "aws_test",
"success" : true
} ]\
}

200 Response: Updated failured

Copy
{
  "failedAccounts" : [ {
    "accountName" : "aws_test",
    "success" : false,
    "errorMessage" : "Invalid keys"
  } ]
}