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
870 changes: 868 additions & 2 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions examples/v2/deployment-gates/CreateDeploymentGate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Create deployment gate 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.CreateDeploymentGateParams;
import com.datadog.api.client.v2.model.CreateDeploymentGateParamsData;
import com.datadog.api.client.v2.model.CreateDeploymentGateParamsDataAttributes;
import com.datadog.api.client.v2.model.DeploymentGateDataType;
import com.datadog.api.client.v2.model.DeploymentGateResponse;

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

CreateDeploymentGateParams body =
new CreateDeploymentGateParams()
.data(
new CreateDeploymentGateParamsData()
.attributes(
new CreateDeploymentGateParamsDataAttributes()
.dryRun(false)
.env("production")
.identifier("my-gate-1")
.service("my-service"))
.type(DeploymentGateDataType.DEPLOYMENT_GATE));

try {
DeploymentGateResponse result = apiInstance.createDeploymentGate(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#createDeploymentGate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
49 changes: 49 additions & 0 deletions examples/v2/deployment-gates/CreateDeploymentRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Create deployment rule 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.CreateDeploymentRuleParams;
import com.datadog.api.client.v2.model.CreateDeploymentRuleParamsData;
import com.datadog.api.client.v2.model.CreateDeploymentRuleParamsDataAttributes;
import com.datadog.api.client.v2.model.DeploymentRuleDataType;
import com.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection;
import com.datadog.api.client.v2.model.DeploymentRuleResponse;
import com.datadog.api.client.v2.model.DeploymentRulesOptions;

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

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

CreateDeploymentRuleParams body =
new CreateDeploymentRuleParams()
.data(
new CreateDeploymentRuleParamsData()
.attributes(
new CreateDeploymentRuleParamsDataAttributes()
.dryRun(false)
.name("My deployment rule")
.options(
new DeploymentRulesOptions(
new DeploymentRuleOptionsFaultyDeploymentDetection()))
.type("faulty_deployment_detection"))
.type(DeploymentRuleDataType.DEPLOYMENT_RULE));

try {
DeploymentRuleResponse result =
apiInstance.createDeploymentRule(DEPLOYMENT_GATE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#createDeploymentRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
26 changes: 26 additions & 0 deletions examples/v2/deployment-gates/DeleteDeploymentGate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Delete deployment gate returns "No Content" response

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

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

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

try {
apiInstance.deleteDeploymentGate(DEPLOYMENT_GATE_DATA_ID);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentGate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
29 changes: 29 additions & 0 deletions examples/v2/deployment-gates/DeleteDeploymentRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Delete deployment rule returns "No Content" response

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

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

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

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

try {
apiInstance.deleteDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#deleteDeploymentRule");
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/deployment-gates/GetDeploymentGate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get deployment gate 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.DeploymentGateResponse;

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

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

try {
DeploymentGateResponse result = apiInstance.getDeploymentGate(DEPLOYMENT_GATE_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#getDeploymentGate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
32 changes: 32 additions & 0 deletions examples/v2/deployment-gates/GetDeploymentRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Get deployment rule 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.DeploymentRuleResponse;

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

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

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

try {
DeploymentRuleResponse result =
apiInstance.getDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#getDeploymentRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
41 changes: 41 additions & 0 deletions examples/v2/deployment-gates/UpdateDeploymentGate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Update deployment gate 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.DeploymentGateDataType;
import com.datadog.api.client.v2.model.DeploymentGateResponse;
import com.datadog.api.client.v2.model.UpdateDeploymentGateParams;
import com.datadog.api.client.v2.model.UpdateDeploymentGateParamsData;
import com.datadog.api.client.v2.model.UpdateDeploymentGateParamsDataAttributes;

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

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

UpdateDeploymentGateParams body =
new UpdateDeploymentGateParams()
.data(
new UpdateDeploymentGateParamsData()
.attributes(new UpdateDeploymentGateParamsDataAttributes().dryRun(false))
.id("12345678-1234-1234-1234-123456789012")
.type(DeploymentGateDataType.DEPLOYMENT_GATE));

try {
DeploymentGateResponse result =
apiInstance.updateDeploymentGate(DEPLOYMENT_GATE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentGate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
51 changes: 51 additions & 0 deletions examples/v2/deployment-gates/UpdateDeploymentRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Update deployment rule 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.DeploymentRuleDataType;
import com.datadog.api.client.v2.model.DeploymentRuleOptionsFaultyDeploymentDetection;
import com.datadog.api.client.v2.model.DeploymentRuleResponse;
import com.datadog.api.client.v2.model.DeploymentRulesOptions;
import com.datadog.api.client.v2.model.UpdateDeploymentRuleParams;
import com.datadog.api.client.v2.model.UpdateDeploymentRuleParamsData;
import com.datadog.api.client.v2.model.UpdateDeploymentRuleParamsDataAttributes;

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

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

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

UpdateDeploymentRuleParams body =
new UpdateDeploymentRuleParams()
.data(
new UpdateDeploymentRuleParamsData()
.attributes(
new UpdateDeploymentRuleParamsDataAttributes()
.dryRun(false)
.name("Updated deployment rule")
.options(
new DeploymentRulesOptions(
new DeploymentRuleOptionsFaultyDeploymentDetection())))
.type(DeploymentRuleDataType.DEPLOYMENT_RULE));

try {
DeploymentRuleResponse result =
apiInstance.updateDeploymentRule(DEPLOYMENT_GATE_DATA_ID, DEPLOYMENT_RULE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DeploymentGatesApi#updateDeploymentRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,14 @@ public class ApiClient {
put("v2.cancelDataDeletionRequest", false);
put("v2.createDataDeletionRequest", false);
put("v2.getDataDeletionRequests", false);
put("v2.createDeploymentGate", false);
put("v2.createDeploymentRule", false);
put("v2.deleteDeploymentGate", false);
put("v2.deleteDeploymentRule", false);
put("v2.getDeploymentGate", false);
put("v2.getDeploymentRule", false);
put("v2.updateDeploymentGate", false);
put("v2.updateDeploymentRule", false);
put("v2.createIncident", false);
put("v2.createIncidentImpact", false);
put("v2.createIncidentIntegration", false);
Expand Down
Loading
Loading