Skip to content
Open
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
387 changes: 387 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Get a deployment gate evaluation result returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse;
import java.util.UUID;

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

try {
DeploymentGatesEvaluationResultResponse result =
apiInstance.getDeploymentGatesEvaluationResult(
UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling DeploymentGatesApi#getDeploymentGatesEvaluationResult");
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,37 @@
// Get a deployment gates evaluation result returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResultResponse;
import java.util.UUID;

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

// there is a valid "deployment_gates_evaluation" in the system
UUID DEPLOYMENT_GATES_EVALUATION_DATA_ID = null;
try {
DEPLOYMENT_GATES_EVALUATION_DATA_ID =
UUID.fromString(System.getenv("DEPLOYMENT_GATES_EVALUATION_DATA_ID"));
} catch (IllegalArgumentException e) {
System.err.println("Error parsing UUID: " + e.getMessage());
}

try {
DeploymentGatesEvaluationResultResponse result =
apiInstance.getDeploymentGatesEvaluationResult(DEPLOYMENT_GATES_EVALUATION_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling DeploymentGatesApi#getDeploymentGatesEvaluationResult");
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/deployment-gates/ListDeploymentGates.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get all deployment gates returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesListResponse;

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

try {
DeploymentGatesListResponse result = apiInstance.listDeploymentGates();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#listDeploymentGates");
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,45 @@
// Trigger a deployment gate evaluation returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse;

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

DeploymentGatesEvaluationRequest body =
new DeploymentGatesEvaluationRequest()
.data(
new DeploymentGatesEvaluationRequestData()
.attributes(
new DeploymentGatesEvaluationRequestAttributes()
.env("staging")
.identifier("pre-deploy")
.primaryTag("region:us-east-1")
.service("transaction-backend")
.version("v1.2.3"))
.type(
DeploymentGatesEvaluationRequestDataType
.DEPLOYMENT_GATES_EVALUATION_REQUEST));

try {
DeploymentGatesEvaluationResponse result = apiInstance.triggerDeploymentGatesEvaluation(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation");
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,47 @@
// Trigger a deployment gates evaluation returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.DeploymentGatesApi;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequest;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestAttributes;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestData;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationRequestDataType;
import com.datadog.api.client.v2.model.DeploymentGatesEvaluationResponse;

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

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

DeploymentGatesEvaluationRequest body =
new DeploymentGatesEvaluationRequest()
.data(
new DeploymentGatesEvaluationRequestData()
.attributes(
new DeploymentGatesEvaluationRequestAttributes()
.env("production")
.identifier(DEPLOYMENT_GATE_DATA_ATTRIBUTES_IDENTIFIER)
.service("my-service"))
.type(
DeploymentGatesEvaluationRequestDataType
.DEPLOYMENT_GATES_EVALUATION_REQUEST));

try {
DeploymentGatesEvaluationResponse result = apiInstance.triggerDeploymentGatesEvaluation(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling DeploymentGatesApi#triggerDeploymentGatesEvaluation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,10 @@ public class ApiClient {
put("v2.deleteDeploymentRule", false);
put("v2.getDeploymentGate", false);
put("v2.getDeploymentGateRules", false);
put("v2.getDeploymentGatesEvaluationResult", false);
put("v2.getDeploymentRule", false);
put("v2.listDeploymentGates", false);
put("v2.triggerDeploymentGatesEvaluation", false);
put("v2.updateDeploymentGate", false);
put("v2.updateDeploymentRule", false);
put("v2.createHamrOrgConnection", false);
Expand Down
Loading
Loading