@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
301 lines (300 loc) • 11.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a Rest API check on a resource within Azure DevOps.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const exampleServiceEndpointGeneric = new azuredevops.ServiceEndpointGeneric("example", {
* projectId: example.id,
* serverUrl: "https://some-server.example.com",
* serviceEndpointName: "Example Generic",
* username: "username",
* password: "password",
* description: "Managed by Pulumi",
* });
* const exampleAzure = new azuredevops.ServiceEndpointGeneric("example_azure", {
* projectId: example.id,
* serverUrl: "https://dev.azure.com/",
* serviceEndpointName: "Example Generic Azure",
* username: "username",
* password: "dummy",
* });
* const exampleVariableGroup = new azuredevops.VariableGroup("example", {
* projectId: example.id,
* name: "Example Variable Group",
* allowAccess: true,
* variables: [{
* name: "FOO",
* value: "BAR",
* }],
* });
* const exampleCheckRestApi = new azuredevops.CheckRestApi("example", {
* projectId: example.id,
* targetResourceId: exampleServiceEndpointGeneric.id,
* targetResourceType: "endpoint",
* displayName: "Example REST API Check",
* connectedServiceNameSelector: "connectedServiceName",
* connectedServiceName: exampleAzure.serviceEndpointName,
* method: "POST",
* headers: "{\"contentType\":\"application/json\"}",
* body: "{\"params\":\"value\"}",
* completionEvent: "ApiResponse",
* successCriteria: "eq(root['status'], '200')",
* urlSuffix: "user/1",
* retryInterval: 4000,
* variableGroupName: exampleVariableGroup.name,
* timeout: 40000,
* });
* ```
*
* ## Relevant Links
*
* - [Define approvals and checks](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass)
*
* ## Import
*
* Importing this resource is not supported.
*/
export declare class CheckRestApi extends pulumi.CustomResource {
/**
* Get an existing CheckRestApi resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CheckRestApiState, opts?: pulumi.CustomResourceOptions): CheckRestApi;
/**
* Returns true if the given object is an instance of CheckRestApi. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is CheckRestApi;
/**
* The Rest API request body.
*/
readonly body: pulumi.Output<string | undefined>;
/**
* The completion event of the Rest API call. Possible values: `Callback`, `ApiResponse`. Defaults to `Callback`.
*/
readonly completionEvent: pulumi.Output<string | undefined>;
/**
* The name of the Service Connection.
*/
readonly connectedServiceName: pulumi.Output<string>;
/**
* The type of the Service Connection used to invoke the REST API. Possible values: `connectedServiceName`(**Generic** type service connection) and `connectedServiceNameARM`(**Azure Resource Manager** type service connection).
*/
readonly connectedServiceNameSelector: pulumi.Output<string>;
/**
* The Name of the Rest API check.
*/
readonly displayName: pulumi.Output<string>;
/**
* The headers of the request in JSON format.
*/
readonly headers: pulumi.Output<string | undefined>;
/**
* The HTTP method of the request. Possible values: `OPTIONS`, `GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `TRACE`, `PATCH`
*/
readonly method: pulumi.Output<string>;
/**
* The ID of the project. Changing this forces a new resource to be created.
*/
readonly projectId: pulumi.Output<string>;
/**
* The time between evaluations (minutes).
*
* ~>**NOTE** 1. The retry times should less them 10 based on the timeout. For example: `timeout` is `4000` then `retryInterval` should be `0` or no less then `400`.
* <br>2. `retryInterval` is not required when `completion_event=Callback`.
*/
readonly retryInterval: pulumi.Output<number | undefined>;
/**
* The Criteria which defines when to pass the task. No criteria means response content does not influence the result.
*
* ~>**NOTE** `successCriteria` is used when `completion_event=ApiResponse`
*/
readonly successCriteria: pulumi.Output<string | undefined>;
/**
* The ID of the resource being protected by the check. Changing this forces a new resource to be created
*/
readonly targetResourceId: pulumi.Output<string>;
/**
* The type of resource being protected by the check. Possible values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new resource to be created.
*/
readonly targetResourceType: pulumi.Output<string>;
/**
* The timeout in minutes for the Rest API check. Defaults to `1440`.
*/
readonly timeout: pulumi.Output<number | undefined>;
/**
* The URL suffix and parameters.
*/
readonly urlSuffix: pulumi.Output<string | undefined>;
/**
* The name of the Variable Group.
*/
readonly variableGroupName: pulumi.Output<string | undefined>;
/**
* The version of the Rest API check.
*/
readonly version: pulumi.Output<number>;
/**
* Create a CheckRestApi resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: CheckRestApiArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CheckRestApi resources.
*/
export interface CheckRestApiState {
/**
* The Rest API request body.
*/
body?: pulumi.Input<string>;
/**
* The completion event of the Rest API call. Possible values: `Callback`, `ApiResponse`. Defaults to `Callback`.
*/
completionEvent?: pulumi.Input<string>;
/**
* The name of the Service Connection.
*/
connectedServiceName?: pulumi.Input<string>;
/**
* The type of the Service Connection used to invoke the REST API. Possible values: `connectedServiceName`(**Generic** type service connection) and `connectedServiceNameARM`(**Azure Resource Manager** type service connection).
*/
connectedServiceNameSelector?: pulumi.Input<string>;
/**
* The Name of the Rest API check.
*/
displayName?: pulumi.Input<string>;
/**
* The headers of the request in JSON format.
*/
headers?: pulumi.Input<string>;
/**
* The HTTP method of the request. Possible values: `OPTIONS`, `GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `TRACE`, `PATCH`
*/
method?: pulumi.Input<string>;
/**
* The ID of the project. Changing this forces a new resource to be created.
*/
projectId?: pulumi.Input<string>;
/**
* The time between evaluations (minutes).
*
* ~>**NOTE** 1. The retry times should less them 10 based on the timeout. For example: `timeout` is `4000` then `retryInterval` should be `0` or no less then `400`.
* <br>2. `retryInterval` is not required when `completion_event=Callback`.
*/
retryInterval?: pulumi.Input<number>;
/**
* The Criteria which defines when to pass the task. No criteria means response content does not influence the result.
*
* ~>**NOTE** `successCriteria` is used when `completion_event=ApiResponse`
*/
successCriteria?: pulumi.Input<string>;
/**
* The ID of the resource being protected by the check. Changing this forces a new resource to be created
*/
targetResourceId?: pulumi.Input<string>;
/**
* The type of resource being protected by the check. Possible values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new resource to be created.
*/
targetResourceType?: pulumi.Input<string>;
/**
* The timeout in minutes for the Rest API check. Defaults to `1440`.
*/
timeout?: pulumi.Input<number>;
/**
* The URL suffix and parameters.
*/
urlSuffix?: pulumi.Input<string>;
/**
* The name of the Variable Group.
*/
variableGroupName?: pulumi.Input<string>;
/**
* The version of the Rest API check.
*/
version?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a CheckRestApi resource.
*/
export interface CheckRestApiArgs {
/**
* The Rest API request body.
*/
body?: pulumi.Input<string>;
/**
* The completion event of the Rest API call. Possible values: `Callback`, `ApiResponse`. Defaults to `Callback`.
*/
completionEvent?: pulumi.Input<string>;
/**
* The name of the Service Connection.
*/
connectedServiceName: pulumi.Input<string>;
/**
* The type of the Service Connection used to invoke the REST API. Possible values: `connectedServiceName`(**Generic** type service connection) and `connectedServiceNameARM`(**Azure Resource Manager** type service connection).
*/
connectedServiceNameSelector: pulumi.Input<string>;
/**
* The Name of the Rest API check.
*/
displayName: pulumi.Input<string>;
/**
* The headers of the request in JSON format.
*/
headers?: pulumi.Input<string>;
/**
* The HTTP method of the request. Possible values: `OPTIONS`, `GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `TRACE`, `PATCH`
*/
method: pulumi.Input<string>;
/**
* The ID of the project. Changing this forces a new resource to be created.
*/
projectId: pulumi.Input<string>;
/**
* The time between evaluations (minutes).
*
* ~>**NOTE** 1. The retry times should less them 10 based on the timeout. For example: `timeout` is `4000` then `retryInterval` should be `0` or no less then `400`.
* <br>2. `retryInterval` is not required when `completion_event=Callback`.
*/
retryInterval?: pulumi.Input<number>;
/**
* The Criteria which defines when to pass the task. No criteria means response content does not influence the result.
*
* ~>**NOTE** `successCriteria` is used when `completion_event=ApiResponse`
*/
successCriteria?: pulumi.Input<string>;
/**
* The ID of the resource being protected by the check. Changing this forces a new resource to be created
*/
targetResourceId: pulumi.Input<string>;
/**
* The type of resource being protected by the check. Possible values: `endpoint`, `environment`, `queue`, `repository`, `securefile`, `variablegroup`. Changing this forces a new resource to be created.
*/
targetResourceType: pulumi.Input<string>;
/**
* The timeout in minutes for the Rest API check. Defaults to `1440`.
*/
timeout?: pulumi.Input<number>;
/**
* The URL suffix and parameters.
*/
urlSuffix?: pulumi.Input<string>;
/**
* The name of the Variable Group.
*/
variableGroupName?: pulumi.Input<string>;
}