UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

114 lines 4.34 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Api = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A consumable API that can be used by multiple Gateways. * * To get more information about Api, see: * * * [API documentation](https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.apis) * * How-to Guides * * [Official Documentation](https://cloud.google.com/api-gateway/docs/quickstart) * * ## Example Usage * * ### Apigateway Api Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const api = new gcp.apigateway.Api("api", {apiId: "my-api"}); * ``` * * ## Import * * Api can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/global/apis/{{api_id}}` * * * `{{project}}/{{api_id}}` * * * `{{api_id}}` * * When using the `pulumi import` command, Api can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigateway/api:Api default projects/{{project}}/locations/global/apis/{{api_id}} * ``` * * ```sh * $ pulumi import gcp:apigateway/api:Api default {{project}}/{{api_id}} * ``` * * ```sh * $ pulumi import gcp:apigateway/api:Api default {{api_id}} * ``` */ 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, id, state, opts) { return new Api(name, state, { ...opts, id: id }); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Api.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiId"] = state?.apiId; resourceInputs["createTime"] = state?.createTime; resourceInputs["displayName"] = state?.displayName; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["labels"] = state?.labels; resourceInputs["managedService"] = state?.managedService; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; } else { const args = argsOrState; if (args?.apiId === undefined && !opts.urn) { throw new Error("Missing required property 'apiId'"); } resourceInputs["apiId"] = args?.apiId; resourceInputs["displayName"] = args?.displayName; resourceInputs["labels"] = args?.labels; resourceInputs["managedService"] = args?.managedService; resourceInputs["project"] = args?.project; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Api.__pulumiType, name, resourceInputs, opts); } } exports.Api = Api; /** @internal */ Api.__pulumiType = 'gcp:apigateway/api:Api'; //# sourceMappingURL=api.js.map