The Cloud Foundry credentials API has been deprecated with Dynatrace version 1.288. It is replaced by the Settings API and the Cloud Foundry schema (builtin:cloud.cloudfoundry
). We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for the request.
/api/v2/settings
/api/config/v1/cloudFoundry/credentials
settings.read
)settings.write
)ReadConfig
)WriteConfig
)To learn about new query/body parameters, see the documentation of individual requests in the Settings API.
In the Settings 2.0 framework, each Cloud Foundry connection is represented by a settings object. An object contains some metadata (like the scope or creation timestamp) and the configuration itself, encapsulated in the value object. To learn about the parameters of a Cloud Foundry connection, query the Cloud Foundry schema (builtin:cloud.cloudfoundry
) with the GET a schema request. The configuration differs from the Cloud Foundry credentials API – check the examples below to see the differences.
Here are some examples of differences in API usage.
To list all Cloud Foundry connection settings, you need the GET objects request. In query parameters, set schemaIds to builtin:cloud.cloudfoundry
and scopes to environment
.
GET https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin:cloud.cloudfoundry&scopes=environment
{"items": [{"objectId": "<OBJECT-ID-1>","value": {"enabled": true,"label": "my-test-foundation","apiUrl": "https://api.sample-cloud-foundry-foundation.com/","loginUrl": "https://login.sample-cloud-foundry-foundation.com/","username": "my-foundation-admin","password": "<PASSWORD>","activeGateGroup": "testgroup"}},{"objectId": "<OBJECT-ID-2>","value": {"enabled": true,"label": "my-other-foundation","apiUrl": "https://api.other-cloud-foundry-foundation.com/","loginUrl": "https://login.other-cloud-foundry-foundation.com/","username": "my-other-admin","password": "<PASSWORD>"}}],"totalCount": 2,"pageSize": 100}
To get details for a specific Cloud Foundry connection, you need the GET object request. Use the objectId of the object from which you want to get details as parameter in the path.
GET https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects/<OBJECT-ID>
{"objectId": "<OBJECT-ID>","summary": "my\\-test\\-foundation","searchSummary": "my-test-foundation","created": 1674052402929,"modified": 1674541517381,"author": "user.account","updateToken": "<UPDATE-TOKEN>","scope": "environment","schemaId": "builtin:cloud.cloudfoundry","schemaVersion": "1.1","value": {"enabled": true,"label": "my-test-foundation","apiUrl": "https://api.sample-cloud-foundry-foundation.com/","loginUrl": "https://login.sample-cloud-foundry-foundation.com/","username": "my-foundation-admin","password": "<PASSWORD>","activeGateGroup": "testgroup"}}
In this example, we validate if the request for creating a new Cloud Foundry connection would be successful.
To validate creation of a Cloud Foundry connection, you need the POST an object request with the parameter validateOnly
set to true
. In the request body, set schemaId to builtin:cloud.cloudfoundry
and scope to environment
. Provide the Cloud Foundry connection configuration in the value object.
POST https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects?validateOnly=true
[{"scope": "environment","schemaId": "builtin:cloud.cloudfoundry","value": {"enabled": true,"label": "new-foundation","apiUrl": "https://api.new-cloud-foundry-foundation.com/","loginUrl": "https://login.new-cloud-foundry-foundation.com/","username": "new-foundation-admin","password": "<PASSWORD>","activeGateGroup": "new-group"}}]
[{"code": 200}]
[{"code": 400,"error": {"code": 400,"message": "Validation failed for 2 Validators.","constraintViolations": [{"path": "builtin:cloud.cloudfoundry","message": "Specified URL is already used in another configuration.","parameterLocation": "PAYLOAD_BODY","location": null},{"path": "builtin:cloud.cloudfoundry","message": "Specified URL is already used in another configuration.","parameterLocation": "PAYLOAD_BODY","location": null}]},"invalidValue": {"enabled": true,"label": "new-foundation","apiUrl": "https://api.new-cloud-foundry-foundation.com/","loginUrl": "https://login.new-cloud-foundry-foundation.com/","username": "new-foundation-admin","password": "<PASSWORD>","activeGateGroup": "new-group"}}]
In this example, we create a Cloud Foundry connection.
To create a Cloud Foundry connection, you need the POST an object request. In the request body, set schemaId to builtin:cloud.cloudfoundry
and scope to environment
. Provide the Cloud Foundry connection configuration in the value object.
The response contains the ID of the object that you need to manage the settings.
POST https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects
[{"scope": "environment","schemaId": "builtin:cloud.cloudfoundry","value": {"enabled": true,"label": "new-foundation","apiUrl": "https://api.new-cloud-foundry-foundation.com/","loginUrl": "https://login.new-cloud-foundry-foundation.com/","username": "new-foundation-admin","password": "<PASSWORD>","activeGateGroup": "new-group"}}]
[{"code": 200,"objectId": "<OBJECT-ID>"}]
In this example, we modify the Cloud Foundry connection created in the previous example. We change the username to foundation-admin
.
To edit a Cloud Foundry connection, you need the PUT an object request.
PUT https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects/<OBJECT-ID>
{"scope": "environment","schemaId": "builtin:cloud.cloudfoundry","value": {"enabled": true,"label": "new-foundation","apiUrl": "https://api.new-cloud-foundry-foundation.com/","loginUrl": "https://login.new-cloud-foundry-foundation.com/","username": "foundation-admin","password": "<PASSWORD>","activeGateGroup": "new-group"}}
{"code": 200,"objectId": "<OBJECT-ID>"}
In this example, we delete the previously created Cloud Foundry connection again.
To delete a Cloud Foundry connection, you need the DELETE an object request.
DELETE https://mySampleEnv.live.dynatrace.com/api/v2/settings/objects/<OBJECT-ID>