1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. apphub
  5. getDiscoveredWorkload
Google Cloud Classic v7.23.0 published on Wednesday, May 15, 2024 by Pulumi

gcp.apphub.getDiscoveredWorkload

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.23.0 published on Wednesday, May 15, 2024 by Pulumi

    Get information about a discovered workload from its uri.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my-workload = gcp.apphub.getDiscoveredWorkload({
        location: "us-central1",
        workloadUri: "my-workload-uri",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_workload = gcp.apphub.get_discovered_workload(location="us-central1",
        workload_uri="my-workload-uri")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apphub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := apphub.GetDiscoveredWorkload(ctx, &apphub.GetDiscoveredWorkloadArgs{
    			Location:    "us-central1",
    			WorkloadUri: "my-workload-uri",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_workload = Gcp.Apphub.GetDiscoveredWorkload.Invoke(new()
        {
            Location = "us-central1",
            WorkloadUri = "my-workload-uri",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.apphub.ApphubFunctions;
    import com.pulumi.gcp.apphub.inputs.GetDiscoveredWorkloadArgs;
    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 my-workload = ApphubFunctions.getDiscoveredWorkload(GetDiscoveredWorkloadArgs.builder()
                .location("us-central1")
                .workloadUri("my-workload-uri")
                .build());
    
        }
    }
    
    variables:
      my-workload:
        fn::invoke:
          Function: gcp:apphub:getDiscoveredWorkload
          Arguments:
            location: us-central1
            workloadUri: my-workload-uri
    

    Using getDiscoveredWorkload

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDiscoveredWorkload(args: GetDiscoveredWorkloadArgs, opts?: InvokeOptions): Promise<GetDiscoveredWorkloadResult>
    function getDiscoveredWorkloadOutput(args: GetDiscoveredWorkloadOutputArgs, opts?: InvokeOptions): Output<GetDiscoveredWorkloadResult>
    def get_discovered_workload(location: Optional[str] = None,
                                project: Optional[str] = None,
                                workload_uri: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetDiscoveredWorkloadResult
    def get_discovered_workload_output(location: Optional[pulumi.Input[str]] = None,
                                project: Optional[pulumi.Input[str]] = None,
                                workload_uri: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetDiscoveredWorkloadResult]
    func GetDiscoveredWorkload(ctx *Context, args *GetDiscoveredWorkloadArgs, opts ...InvokeOption) (*GetDiscoveredWorkloadResult, error)
    func GetDiscoveredWorkloadOutput(ctx *Context, args *GetDiscoveredWorkloadOutputArgs, opts ...InvokeOption) GetDiscoveredWorkloadResultOutput

    > Note: This function is named GetDiscoveredWorkload in the Go SDK.

    public static class GetDiscoveredWorkload 
    {
        public static Task<GetDiscoveredWorkloadResult> InvokeAsync(GetDiscoveredWorkloadArgs args, InvokeOptions? opts = null)
        public static Output<GetDiscoveredWorkloadResult> Invoke(GetDiscoveredWorkloadInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDiscoveredWorkloadResult> getDiscoveredWorkload(GetDiscoveredWorkloadArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:apphub/getDiscoveredWorkload:getDiscoveredWorkload
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the discovered workload.
    WorkloadUri string
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    Project string
    The host project of the discovered workload.
    Location string
    The location of the discovered workload.
    WorkloadUri string
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    Project string
    The host project of the discovered workload.
    location String
    The location of the discovered workload.
    workloadUri String
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    project String
    The host project of the discovered workload.
    location string
    The location of the discovered workload.
    workloadUri string
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    project string
    The host project of the discovered workload.
    location str
    The location of the discovered workload.
    workload_uri str
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    project str
    The host project of the discovered workload.
    location String
    The location of the discovered workload.
    workloadUri String
    The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
    project String
    The host project of the discovered workload.

    getDiscoveredWorkload Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The location that the underlying resource resides in.
    Name string
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    WorkloadProperties List<GetDiscoveredWorkloadWorkloadProperty>
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    WorkloadReferences List<GetDiscoveredWorkloadWorkloadReference>
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    WorkloadUri string
    Project string
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The location that the underlying resource resides in.
    Name string
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    WorkloadProperties []GetDiscoveredWorkloadWorkloadProperty
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    WorkloadReferences []GetDiscoveredWorkloadWorkloadReference
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    WorkloadUri string
    Project string
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The location that the underlying resource resides in.
    name String
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    workloadProperties List<GetDiscoveredWorkloadWorkloadProperty>
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    workloadReferences List<GetDiscoveredWorkloadWorkloadReference>
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    workloadUri String
    project String
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The location that the underlying resource resides in.
    name string
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    workloadProperties GetDiscoveredWorkloadWorkloadProperty[]
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    workloadReferences GetDiscoveredWorkloadWorkloadReference[]
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    workloadUri string
    project string
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The location that the underlying resource resides in.
    name str
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    workload_properties Sequence[GetDiscoveredWorkloadWorkloadProperty]
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    workload_references Sequence[GetDiscoveredWorkloadWorkloadReference]
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    workload_uri str
    project str
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The location that the underlying resource resides in.
    name String
    Resource name of a Workload. Format: "projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}".
    workloadProperties List<Property Map>
    Properties of an underlying compute resource that can comprise a Workload. Structure is documented below
    workloadReferences List<Property Map>
    Reference to an underlying networking resource that can comprise a Workload. Structure is documented below
    workloadUri String
    project String

    Supporting Types

    GetDiscoveredWorkloadWorkloadProperty

    GcpProject string
    The service project identifier that the underlying cloud resource resides in.
    Location string
    The location of the discovered workload.
    Zone string
    The location that the underlying resource resides in if it is zonal.
    GcpProject string
    The service project identifier that the underlying cloud resource resides in.
    Location string
    The location of the discovered workload.
    Zone string
    The location that the underlying resource resides in if it is zonal.
    gcpProject String
    The service project identifier that the underlying cloud resource resides in.
    location String
    The location of the discovered workload.
    zone String
    The location that the underlying resource resides in if it is zonal.
    gcpProject string
    The service project identifier that the underlying cloud resource resides in.
    location string
    The location of the discovered workload.
    zone string
    The location that the underlying resource resides in if it is zonal.
    gcp_project str
    The service project identifier that the underlying cloud resource resides in.
    location str
    The location of the discovered workload.
    zone str
    The location that the underlying resource resides in if it is zonal.
    gcpProject String
    The service project identifier that the underlying cloud resource resides in.
    location String
    The location of the discovered workload.
    zone String
    The location that the underlying resource resides in if it is zonal.

    GetDiscoveredWorkloadWorkloadReference

    Uri string
    The underlying resource URI.
    Uri string
    The underlying resource URI.
    uri String
    The underlying resource URI.
    uri string
    The underlying resource URI.
    uri str
    The underlying resource URI.
    uri String
    The underlying resource URI.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.23.0 published on Wednesday, May 15, 2024 by Pulumi