com.pulumi.azure.apimanagement.GatewayApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.apimanagement;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.apimanagement.GatewayApiArgs;
import com.pulumi.azure.apimanagement.inputs.GatewayApiState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;
/**
* Manages a API Management Gateway API.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.apimanagement.ApimanagementFunctions;
* import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
* import com.pulumi.azure.apimanagement.inputs.GetApiArgs;
* import com.pulumi.azure.apimanagement.inputs.GetGatewayArgs;
* import com.pulumi.azure.apimanagement.GatewayApi;
* import com.pulumi.azure.apimanagement.GatewayApiArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* final var example = ApimanagementFunctions.getService(GetServiceArgs.builder()
* .name("example-api")
* .resourceGroupName("example-resources")
* .build());
*
* final var exampleGetApi = ApimanagementFunctions.getApi(GetApiArgs.builder()
* .name("search-api")
* .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
* .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
* .revision("2")
* .build());
*
* final var exampleGetGateway = ApimanagementFunctions.getGateway(GetGatewayArgs.builder()
* .name("example-gateway")
* .apiManagementId(example.applyValue(getServiceResult -> getServiceResult.id()))
* .build());
*
* var exampleGatewayApi = new GatewayApi("exampleGatewayApi", GatewayApiArgs.builder()
* .gatewayId(exampleGetGateway.applyValue(getGatewayResult -> getGatewayResult.id()))
* .apiId(exampleGetApi.applyValue(getApiResult -> getApiResult.id()))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* API Management Gateway APIs can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:apimanagement/gatewayApi:GatewayApi example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.ApiManagement/service/service1/gateways/gateway1/apis/api1
* ```
*
*/
@ResourceType(type="azure:apimanagement/gatewayApi:GatewayApi")
public class GatewayApi extends com.pulumi.resources.CustomResource {
/**
* The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
*
*/
@Export(name="apiId", refs={String.class}, tree="[0]")
private Output apiId;
/**
* @return The Identifier of the API Management API within the API Management Service. Changing this forces a new API Management Gateway API to be created.
*
*/
public Output apiId() {
return this.apiId;
}
/**
* The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
*
*/
@Export(name="gatewayId", refs={String.class}, tree="[0]")
private Output gatewayId;
/**
* @return The Identifier for the API Management Gateway. Changing this forces a new API Management Gateway API to be created.
*
*/
public Output gatewayId() {
return this.gatewayId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public GatewayApi(java.lang.String name) {
this(name, GatewayApiArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public GatewayApi(java.lang.String name, GatewayApiArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public GatewayApi(java.lang.String name, GatewayApiArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:apimanagement/gatewayApi:GatewayApi", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private GatewayApi(java.lang.String name, Output id, @Nullable GatewayApiState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:apimanagement/gatewayApi:GatewayApi", name, state, makeResourceOptions(options, id), false);
}
private static GatewayApiArgs makeArgs(GatewayApiArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? GatewayApiArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static GatewayApi get(java.lang.String name, Output id, @Nullable GatewayApiState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new GatewayApi(name, id, state, options);
}
}