Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 422 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions examples/v2/fleet-automation/CancelFleetDeployment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Cancel a deployment returns "Deployment successfully canceled." response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FleetAutomationApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.cancelFleetDeployment", true);
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);

try {
apiInstance.cancelFleetDeployment("abc-def-ghi");
} catch (ApiException e) {
System.err.println("Exception when calling FleetAutomationApi#cancelFleetDeployment");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Create a deployment returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FleetAutomationApi;
import com.datadog.api.client.v2.model.FleetDeploymentConfigureAttributes;
import com.datadog.api.client.v2.model.FleetDeploymentConfigureCreate;
import com.datadog.api.client.v2.model.FleetDeploymentConfigureCreateRequest;
import com.datadog.api.client.v2.model.FleetDeploymentFileOp;
import com.datadog.api.client.v2.model.FleetDeploymentOperation;
import com.datadog.api.client.v2.model.FleetDeploymentResourceType;
import com.datadog.api.client.v2.model.FleetDeploymentResponse;
import java.util.Collections;
import java.util.Map;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.createFleetDeploymentConfigure", true);
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);

FleetDeploymentConfigureCreateRequest body =
new FleetDeploymentConfigureCreateRequest()
.data(
new FleetDeploymentConfigureCreate()
.attributes(
new FleetDeploymentConfigureAttributes()
.configOperations(
Collections.singletonList(
new FleetDeploymentOperation()
.fileOp(FleetDeploymentFileOp.MERGE_PATCH)
.filePath("/datadog.yaml")
.patch(
Map.ofEntries(
Map.entry("apm_config", "{'enabled': True}"),
Map.entry("log_level", "debug"),
Map.entry("logs_enabled", "True")))))
.filterQuery("env:prod AND service:web"))
.type(FleetDeploymentResourceType.DEPLOYMENT));

try {
FleetDeploymentResponse result = apiInstance.createFleetDeploymentConfigure(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling FleetAutomationApi#createFleetDeploymentConfigure");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
28 changes: 28 additions & 0 deletions examples/v2/fleet-automation/GetFleetDeployment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get a deployment by ID returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FleetAutomationApi;
import com.datadog.api.client.v2.model.FleetDeploymentResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getFleetDeployment", true);
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);

// there is a valid "deployment" in the system
String DEPLOYMENT_ID = System.getenv("DEPLOYMENT_ID");

try {
FleetDeploymentResponse result = apiInstance.getFleetDeployment(DEPLOYMENT_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FleetAutomationApi#getFleetDeployment");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/fleet-automation/ListFleetDeployments.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// List all deployments returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FleetAutomationApi;
import com.datadog.api.client.v2.model.FleetDeploymentsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listFleetDeployments", true);
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);

try {
FleetDeploymentsResponse result = apiInstance.listFleetDeployments();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FleetAutomationApi#listFleetDeployments");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ public class ApiClient {
protected final Map<String, Boolean> unstableOperations =
new HashMap<String, Boolean>() {
{
put("v2.cancelFleetDeployment", false);
put("v2.createFleetDeploymentConfigure", false);
put("v2.getFleetDeployment", false);
put("v2.listFleetDeployments", false);
put("v2.createOpenAPI", false);
put("v2.deleteOpenAPI", false);
put("v2.getOpenAPI", false);
Expand Down
Loading
Loading