@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
364 lines (363 loc) • 13.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Provides an API gateway API resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const tfApigwGroup = new huaweicloud.sharedapig.Group("tfApigwGroup", {description: "your descpiption"});
* const tfApigwApi = new huaweicloud.sharedapig.Api("tfApigwApi", {
* groupId: tfApigwGroup.id,
* description: "your descpiption",
* tags: [
* "tag1",
* "tag2",
* ],
* visibility: 2,
* authType: "IAM",
* backendType: "HTTP",
* requestProtocol: "HTTPS",
* requestMethod: "GET",
* requestUri: "/test/path1",
* exampleSuccessResponse: "example response",
* httpBackend: {
* protocol: "HTTPS",
* method: "GET",
* uri: "/web/openapi",
* urlDomain: "myhuaweicloud.com",
* timeout: 10000,
* },
* });
* ```
*
* ## Import
*
* API can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:SharedApig/api:Api api "774438a28a574ac8a496325d1bf51807"
* ```
*/
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<pulumi.ID>, 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;
/**
* Specifies the security authentication mode. The value can be 'APP', 'IAM', and '
* NONE'.
*/
readonly authType: pulumi.Output<string>;
/**
* the backend parameter list (documented below).
*/
readonly backendParameters: pulumi.Output<outputs.SharedApig.ApiBackendParameter[] | undefined>;
/**
* Specifies the service backend type. The value can be:
* + 'HTTP': the web service backend
* + 'FUNCTION': the FunctionGraph service backend
* + 'MOCK': the Mock service backend
*/
readonly backendType: pulumi.Output<string>;
/**
* Specifies whether CORS is supported or not.
*/
readonly cors: pulumi.Output<boolean | undefined>;
/**
* Specifies the description of the API. The description cannot exceed 255 characters.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the example response for a failed request The length cannot
* exceed 20,480 characters.
*/
readonly exampleFailureResponse: pulumi.Output<string | undefined>;
/**
* Specifies the example response for a successful request. The length
* cannot exceed 20,480 characters.
*/
readonly exampleSuccessResponse: pulumi.Output<string>;
/**
* Specifies the configuration when backendType selected 'FUNCTION' (documented
* below).
*/
readonly functionBackend: pulumi.Output<outputs.SharedApig.ApiFunctionBackend | undefined>;
/**
* Specifies the ID of the API group. Changing this creates a new resource.
*/
readonly groupId: pulumi.Output<string>;
/**
* The name of the API group to which the API belongs.
*/
readonly groupName: pulumi.Output<string>;
/**
* Specifies the configuration when backendType selected 'HTTP' (documented below).
*/
readonly httpBackend: pulumi.Output<outputs.SharedApig.ApiHttpBackend | undefined>;
/**
* Specifies the configuration when backendType selected 'MOCK' (documented below).
*/
readonly mockBackend: pulumi.Output<outputs.SharedApig.ApiMockBackend | undefined>;
/**
* Specifies the name of the API. An API name consists of 3–64 characters, starting with a
* letter. Only letters, digits, and underscores (_) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* The region in which to create the API resource. If omitted, the provider-level
* region will be used. Changing this creates a new API resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the request method, including 'GET','POST','PUT' and etc..
*/
readonly requestMethod: pulumi.Output<string>;
/**
* the request parameter list (documented below).
*/
readonly requestParameters: pulumi.Output<outputs.SharedApig.ApiRequestParameter[] | undefined>;
/**
* Specifies the request protocol. The value can be 'HTTP', 'HTTPS', and 'BOTH'
* which means the API can be accessed through both 'HTTP' and 'HTTPS'. Defaults to 'HTTPS'.
*/
readonly requestProtocol: pulumi.Output<string | undefined>;
/**
* Specifies the request path of the API. The value must comply with URI
* specifications.
*/
readonly requestUri: pulumi.Output<string>;
/**
* the tags of API in format of string list.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Specifies the version of the API. A maximum of 16 characters are allowed.
*/
readonly version: pulumi.Output<string>;
/**
* Specifies whether the API is available to the public. The value can be 1 (public) and
* 2 (private). Defaults to 2.
*/
readonly visibility: pulumi.Output<number | undefined>;
/**
* 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 {
/**
* Specifies the security authentication mode. The value can be 'APP', 'IAM', and '
* NONE'.
*/
authType?: pulumi.Input<string>;
/**
* the backend parameter list (documented below).
*/
backendParameters?: pulumi.Input<pulumi.Input<inputs.SharedApig.ApiBackendParameter>[]>;
/**
* Specifies the service backend type. The value can be:
* + 'HTTP': the web service backend
* + 'FUNCTION': the FunctionGraph service backend
* + 'MOCK': the Mock service backend
*/
backendType?: pulumi.Input<string>;
/**
* Specifies whether CORS is supported or not.
*/
cors?: pulumi.Input<boolean>;
/**
* Specifies the description of the API. The description cannot exceed 255 characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies the example response for a failed request The length cannot
* exceed 20,480 characters.
*/
exampleFailureResponse?: pulumi.Input<string>;
/**
* Specifies the example response for a successful request. The length
* cannot exceed 20,480 characters.
*/
exampleSuccessResponse?: pulumi.Input<string>;
/**
* Specifies the configuration when backendType selected 'FUNCTION' (documented
* below).
*/
functionBackend?: pulumi.Input<inputs.SharedApig.ApiFunctionBackend>;
/**
* Specifies the ID of the API group. Changing this creates a new resource.
*/
groupId?: pulumi.Input<string>;
/**
* The name of the API group to which the API belongs.
*/
groupName?: pulumi.Input<string>;
/**
* Specifies the configuration when backendType selected 'HTTP' (documented below).
*/
httpBackend?: pulumi.Input<inputs.SharedApig.ApiHttpBackend>;
/**
* Specifies the configuration when backendType selected 'MOCK' (documented below).
*/
mockBackend?: pulumi.Input<inputs.SharedApig.ApiMockBackend>;
/**
* Specifies the name of the API. An API name consists of 3–64 characters, starting with a
* letter. Only letters, digits, and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the API resource. If omitted, the provider-level
* region will be used. Changing this creates a new API resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the request method, including 'GET','POST','PUT' and etc..
*/
requestMethod?: pulumi.Input<string>;
/**
* the request parameter list (documented below).
*/
requestParameters?: pulumi.Input<pulumi.Input<inputs.SharedApig.ApiRequestParameter>[]>;
/**
* Specifies the request protocol. The value can be 'HTTP', 'HTTPS', and 'BOTH'
* which means the API can be accessed through both 'HTTP' and 'HTTPS'. Defaults to 'HTTPS'.
*/
requestProtocol?: pulumi.Input<string>;
/**
* Specifies the request path of the API. The value must comply with URI
* specifications.
*/
requestUri?: pulumi.Input<string>;
/**
* the tags of API in format of string list.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the version of the API. A maximum of 16 characters are allowed.
*/
version?: pulumi.Input<string>;
/**
* Specifies whether the API is available to the public. The value can be 1 (public) and
* 2 (private). Defaults to 2.
*/
visibility?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a Api resource.
*/
export interface ApiArgs {
/**
* Specifies the security authentication mode. The value can be 'APP', 'IAM', and '
* NONE'.
*/
authType: pulumi.Input<string>;
/**
* the backend parameter list (documented below).
*/
backendParameters?: pulumi.Input<pulumi.Input<inputs.SharedApig.ApiBackendParameter>[]>;
/**
* Specifies the service backend type. The value can be:
* + 'HTTP': the web service backend
* + 'FUNCTION': the FunctionGraph service backend
* + 'MOCK': the Mock service backend
*/
backendType: pulumi.Input<string>;
/**
* Specifies whether CORS is supported or not.
*/
cors?: pulumi.Input<boolean>;
/**
* Specifies the description of the API. The description cannot exceed 255 characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies the example response for a failed request The length cannot
* exceed 20,480 characters.
*/
exampleFailureResponse?: pulumi.Input<string>;
/**
* Specifies the example response for a successful request. The length
* cannot exceed 20,480 characters.
*/
exampleSuccessResponse: pulumi.Input<string>;
/**
* Specifies the configuration when backendType selected 'FUNCTION' (documented
* below).
*/
functionBackend?: pulumi.Input<inputs.SharedApig.ApiFunctionBackend>;
/**
* Specifies the ID of the API group. Changing this creates a new resource.
*/
groupId: pulumi.Input<string>;
/**
* Specifies the configuration when backendType selected 'HTTP' (documented below).
*/
httpBackend?: pulumi.Input<inputs.SharedApig.ApiHttpBackend>;
/**
* Specifies the configuration when backendType selected 'MOCK' (documented below).
*/
mockBackend?: pulumi.Input<inputs.SharedApig.ApiMockBackend>;
/**
* Specifies the name of the API. An API name consists of 3–64 characters, starting with a
* letter. Only letters, digits, and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the API resource. If omitted, the provider-level
* region will be used. Changing this creates a new API resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the request method, including 'GET','POST','PUT' and etc..
*/
requestMethod: pulumi.Input<string>;
/**
* the request parameter list (documented below).
*/
requestParameters?: pulumi.Input<pulumi.Input<inputs.SharedApig.ApiRequestParameter>[]>;
/**
* Specifies the request protocol. The value can be 'HTTP', 'HTTPS', and 'BOTH'
* which means the API can be accessed through both 'HTTP' and 'HTTPS'. Defaults to 'HTTPS'.
*/
requestProtocol?: pulumi.Input<string>;
/**
* Specifies the request path of the API. The value must comply with URI
* specifications.
*/
requestUri: pulumi.Input<string>;
/**
* the tags of API in format of string list.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the version of the API. A maximum of 16 characters are allowed.
*/
version?: pulumi.Input<string>;
/**
* Specifies whether the API is available to the public. The value can be 1 (public) and
* 2 (private). Defaults to 2.
*/
visibility?: pulumi.Input<number>;
}