import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an API within an API Management Service. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const exampleService = new azure.apimanagement.Service("example", { * name: "example-apim", * location: example.location, * resourceGroupName: example.name, * publisherName: "My Company", * publisherEmail: "company@exmaple.com", * skuName: "Developer_1", * }); * const exampleApi = new azure.apimanagement.Api("example", { * name: "example-api", * resourceGroupName: example.name, * apiManagementName: exampleService.name, * revision: "1", * displayName: "Example API", * path: "example", * protocols: ["https"], * "import": { * contentFormat: "swagger-link-json", * contentValue: "https://raw.githubusercontent.com/hashicorp/terraform-provider-azurerm/refs/heads/main/internal/services/apimanagement/testdata/api_management_api_schema_swagger.json", * }, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.ApiManagement` - 2022-08-01 * * ## Import * * API Management API's can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:apimanagement/api:Api example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/apis/api1;rev=1 * ``` */ export declare class Api extends pulumi.CustomResource { /** * Get an existing Api 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, state?: ApiState, opts?: pulumi.CustomResourceOptions): Api; /** * Returns true if the given object is an instance of Api. 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 Api; /** * The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. */ readonly apiManagementName: pulumi.Output; /** * Type of API. Possible values are `graphql`, `http`, `soap`, and `websocket`. Defaults to `http`. */ readonly apiType: pulumi.Output; /** * A `contact` block as documented below. */ readonly contact: pulumi.Output; /** * A description of the API Management API, which may include HTML formatting tags. */ readonly description: pulumi.Output; /** * The display name of the API. */ readonly displayName: pulumi.Output; /** * A `import` block as documented below. * * > **Note:** The `displayName`, `description`, `contact`, and `license` fields can be imported by the `import` block, which might cause a drift if these fields are set along with the `import` block. */ readonly import: pulumi.Output; /** * Is this the current API Revision? */ readonly isCurrent: pulumi.Output; /** * Is this API Revision online/accessible via the Gateway? */ readonly isOnline: pulumi.Output; /** * A `license` block as documented below. */ readonly license: pulumi.Output; /** * The name of the API Management API. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * An `oauth2Authorization` block as documented below. */ readonly oauth2Authorization: pulumi.Output; /** * An `openidAuthentication` block as documented below. */ readonly openidAuthentication: pulumi.Output; /** * The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. */ readonly path: pulumi.Output; /** * A list of protocols the operations in this API can be invoked. Possible values are `http`, `https`, `ws`, and `wss`. * * > **Note:** `displayName`, `path` and `protocols` are required when `sourceApiId` is not set. */ readonly protocols: pulumi.Output; /** * The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * The Revision which used for this API. Changing this forces a new resource to be created. */ readonly revision: pulumi.Output; /** * The description of the API Revision of the API Management API. */ readonly revisionDescription: pulumi.Output; /** * Absolute URL of the backend service implementing this API. * * > **Note:** The `serviceUrl` is required when `apiType` is specified as `websocket`. */ readonly serviceUrl: pulumi.Output; /** * The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` */ readonly sourceApiId: pulumi.Output; /** * A `subscriptionKeyParameterNames` block as documented below. */ readonly subscriptionKeyParameterNames: pulumi.Output; /** * Should this API require a subscription key? Defaults to `true`. */ readonly subscriptionRequired: pulumi.Output; /** * Absolute URL of the Terms of Service for the API. */ readonly termsOfServiceUrl: pulumi.Output; /** * The Version number of this API, if this API is versioned. */ readonly version: pulumi.Output; /** * The description of the API Version of the API Management API. */ readonly versionDescription: pulumi.Output; /** * The ID of the Version Set which this API is associated with. * * > **Note:** When `version` is set, `versionSetId` must also be specified */ readonly versionSetId: pulumi.Output; /** * Create a Api 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: ApiArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Api resources. */ export interface ApiState { /** * The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. */ apiManagementName?: pulumi.Input; /** * Type of API. Possible values are `graphql`, `http`, `soap`, and `websocket`. Defaults to `http`. */ apiType?: pulumi.Input; /** * A `contact` block as documented below. */ contact?: pulumi.Input; /** * A description of the API Management API, which may include HTML formatting tags. */ description?: pulumi.Input; /** * The display name of the API. */ displayName?: pulumi.Input; /** * A `import` block as documented below. * * > **Note:** The `displayName`, `description`, `contact`, and `license` fields can be imported by the `import` block, which might cause a drift if these fields are set along with the `import` block. */ import?: pulumi.Input; /** * Is this the current API Revision? */ isCurrent?: pulumi.Input; /** * Is this API Revision online/accessible via the Gateway? */ isOnline?: pulumi.Input; /** * A `license` block as documented below. */ license?: pulumi.Input; /** * The name of the API Management API. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * An `oauth2Authorization` block as documented below. */ oauth2Authorization?: pulumi.Input; /** * An `openidAuthentication` block as documented below. */ openidAuthentication?: pulumi.Input; /** * The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. */ path?: pulumi.Input; /** * A list of protocols the operations in this API can be invoked. Possible values are `http`, `https`, `ws`, and `wss`. * * > **Note:** `displayName`, `path` and `protocols` are required when `sourceApiId` is not set. */ protocols?: pulumi.Input[]>; /** * The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * The Revision which used for this API. Changing this forces a new resource to be created. */ revision?: pulumi.Input; /** * The description of the API Revision of the API Management API. */ revisionDescription?: pulumi.Input; /** * Absolute URL of the backend service implementing this API. * * > **Note:** The `serviceUrl` is required when `apiType` is specified as `websocket`. */ serviceUrl?: pulumi.Input; /** * The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` */ sourceApiId?: pulumi.Input; /** * A `subscriptionKeyParameterNames` block as documented below. */ subscriptionKeyParameterNames?: pulumi.Input; /** * Should this API require a subscription key? Defaults to `true`. */ subscriptionRequired?: pulumi.Input; /** * Absolute URL of the Terms of Service for the API. */ termsOfServiceUrl?: pulumi.Input; /** * The Version number of this API, if this API is versioned. */ version?: pulumi.Input; /** * The description of the API Version of the API Management API. */ versionDescription?: pulumi.Input; /** * The ID of the Version Set which this API is associated with. * * > **Note:** When `version` is set, `versionSetId` must also be specified */ versionSetId?: pulumi.Input; } /** * The set of arguments for constructing a Api resource. */ export interface ApiArgs { /** * The Name of the API Management Service where this API should be created. Changing this forces a new resource to be created. */ apiManagementName: pulumi.Input; /** * Type of API. Possible values are `graphql`, `http`, `soap`, and `websocket`. Defaults to `http`. */ apiType?: pulumi.Input; /** * A `contact` block as documented below. */ contact?: pulumi.Input; /** * A description of the API Management API, which may include HTML formatting tags. */ description?: pulumi.Input; /** * The display name of the API. */ displayName?: pulumi.Input; /** * A `import` block as documented below. * * > **Note:** The `displayName`, `description`, `contact`, and `license` fields can be imported by the `import` block, which might cause a drift if these fields are set along with the `import` block. */ import?: pulumi.Input; /** * A `license` block as documented below. */ license?: pulumi.Input; /** * The name of the API Management API. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * An `oauth2Authorization` block as documented below. */ oauth2Authorization?: pulumi.Input; /** * An `openidAuthentication` block as documented below. */ openidAuthentication?: pulumi.Input; /** * The Path for this API Management API, which is a relative URL which uniquely identifies this API and all of its resource paths within the API Management Service. */ path?: pulumi.Input; /** * A list of protocols the operations in this API can be invoked. Possible values are `http`, `https`, `ws`, and `wss`. * * > **Note:** `displayName`, `path` and `protocols` are required when `sourceApiId` is not set. */ protocols?: pulumi.Input[]>; /** * The Name of the Resource Group where the API Management API exists. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * The Revision which used for this API. Changing this forces a new resource to be created. */ revision: pulumi.Input; /** * The description of the API Revision of the API Management API. */ revisionDescription?: pulumi.Input; /** * Absolute URL of the backend service implementing this API. * * > **Note:** The `serviceUrl` is required when `apiType` is specified as `websocket`. */ serviceUrl?: pulumi.Input; /** * The API id of the source API, which could be in format `azurerm_api_management_api.example.id` or in format `azurerm_api_management_api.example.id;rev=1` */ sourceApiId?: pulumi.Input; /** * A `subscriptionKeyParameterNames` block as documented below. */ subscriptionKeyParameterNames?: pulumi.Input; /** * Should this API require a subscription key? Defaults to `true`. */ subscriptionRequired?: pulumi.Input; /** * Absolute URL of the Terms of Service for the API. */ termsOfServiceUrl?: pulumi.Input; /** * The Version number of this API, if this API is versioned. */ version?: pulumi.Input; /** * The description of the API Version of the API Management API. */ versionDescription?: pulumi.Input; /** * The ID of the Version Set which this API is associated with. * * > **Note:** When `version` is set, `versionSetId` must also be specified */ versionSetId?: pulumi.Input; }