1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ContainerEngine
  5. getWorkRequests
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.ContainerEngine.getWorkRequests

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This data source provides the list of Work Requests in Oracle Cloud Infrastructure Container Engine service.

    List all work requests in a compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testWorkRequests = oci.ContainerEngine.getWorkRequests({
        compartmentId: _var.compartment_id,
        clusterId: oci_containerengine_cluster.test_cluster.id,
        resourceId: oci_containerengine_resource.test_resource.id,
        resourceType: _var.work_request_resource_type,
        statuses: _var.work_request_status,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_work_requests = oci.ContainerEngine.get_work_requests(compartment_id=var["compartment_id"],
        cluster_id=oci_containerengine_cluster["test_cluster"]["id"],
        resource_id=oci_containerengine_resource["test_resource"]["id"],
        resource_type=var["work_request_resource_type"],
        statuses=var["work_request_status"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/ContainerEngine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ContainerEngine.GetWorkRequests(ctx, &containerengine.GetWorkRequestsArgs{
    			CompartmentId: _var.Compartment_id,
    			ClusterId:     pulumi.StringRef(oci_containerengine_cluster.Test_cluster.Id),
    			ResourceId:    pulumi.StringRef(oci_containerengine_resource.Test_resource.Id),
    			ResourceType:  pulumi.StringRef(_var.Work_request_resource_type),
    			Statuses:      _var.Work_request_status,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testWorkRequests = Oci.ContainerEngine.GetWorkRequests.Invoke(new()
        {
            CompartmentId = @var.Compartment_id,
            ClusterId = oci_containerengine_cluster.Test_cluster.Id,
            ResourceId = oci_containerengine_resource.Test_resource.Id,
            ResourceType = @var.Work_request_resource_type,
            Statuses = @var.Work_request_status,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ContainerEngine.ContainerEngineFunctions;
    import com.pulumi.oci.ContainerEngine.inputs.GetWorkRequestsArgs;
    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 testWorkRequests = ContainerEngineFunctions.getWorkRequests(GetWorkRequestsArgs.builder()
                .compartmentId(var_.compartment_id())
                .clusterId(oci_containerengine_cluster.test_cluster().id())
                .resourceId(oci_containerengine_resource.test_resource().id())
                .resourceType(var_.work_request_resource_type())
                .statuses(var_.work_request_status())
                .build());
    
        }
    }
    
    variables:
      testWorkRequests:
        fn::invoke:
          Function: oci:ContainerEngine:getWorkRequests
          Arguments:
            compartmentId: ${var.compartment_id}
            clusterId: ${oci_containerengine_cluster.test_cluster.id}
            resourceId: ${oci_containerengine_resource.test_resource.id}
            resourceType: ${var.work_request_resource_type}
            statuses: ${var.work_request_status}
    

    Using getWorkRequests

    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 getWorkRequests(args: GetWorkRequestsArgs, opts?: InvokeOptions): Promise<GetWorkRequestsResult>
    function getWorkRequestsOutput(args: GetWorkRequestsOutputArgs, opts?: InvokeOptions): Output<GetWorkRequestsResult>
    def get_work_requests(cluster_id: Optional[str] = None,
                          compartment_id: Optional[str] = None,
                          filters: Optional[Sequence[_containerengine.GetWorkRequestsFilter]] = None,
                          resource_id: Optional[str] = None,
                          resource_type: Optional[str] = None,
                          statuses: Optional[Sequence[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetWorkRequestsResult
    def get_work_requests_output(cluster_id: Optional[pulumi.Input[str]] = None,
                          compartment_id: Optional[pulumi.Input[str]] = None,
                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[_containerengine.GetWorkRequestsFilterArgs]]]] = None,
                          resource_id: Optional[pulumi.Input[str]] = None,
                          resource_type: Optional[pulumi.Input[str]] = None,
                          statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetWorkRequestsResult]
    func GetWorkRequests(ctx *Context, args *GetWorkRequestsArgs, opts ...InvokeOption) (*GetWorkRequestsResult, error)
    func GetWorkRequestsOutput(ctx *Context, args *GetWorkRequestsOutputArgs, opts ...InvokeOption) GetWorkRequestsResultOutput

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

    public static class GetWorkRequests 
    {
        public static Task<GetWorkRequestsResult> InvokeAsync(GetWorkRequestsArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkRequestsResult> Invoke(GetWorkRequestsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWorkRequestsResult> getWorkRequests(GetWorkRequestsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ContainerEngine/getWorkRequests:getWorkRequests
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment.
    ClusterId string
    The OCID of the cluster.
    Filters List<GetWorkRequestsFilter>
    ResourceId string
    The OCID of the resource associated with a work request
    ResourceType string
    Type of the resource associated with a work request
    Statuses List<string>
    A work request status to filter on. Can have multiple parameters of this name.
    CompartmentId string
    The OCID of the compartment.
    ClusterId string
    The OCID of the cluster.
    Filters []GetWorkRequestsFilter
    ResourceId string
    The OCID of the resource associated with a work request
    ResourceType string
    Type of the resource associated with a work request
    Statuses []string
    A work request status to filter on. Can have multiple parameters of this name.
    compartmentId String
    The OCID of the compartment.
    clusterId String
    The OCID of the cluster.
    filters List<GetWorkRequestsFilter>
    resourceId String
    The OCID of the resource associated with a work request
    resourceType String
    Type of the resource associated with a work request
    statuses List<String>
    A work request status to filter on. Can have multiple parameters of this name.
    compartmentId string
    The OCID of the compartment.
    clusterId string
    The OCID of the cluster.
    filters GetWorkRequestsFilter[]
    resourceId string
    The OCID of the resource associated with a work request
    resourceType string
    Type of the resource associated with a work request
    statuses string[]
    A work request status to filter on. Can have multiple parameters of this name.
    compartment_id str
    The OCID of the compartment.
    cluster_id str
    The OCID of the cluster.
    filters Sequence[containerengine.GetWorkRequestsFilter]
    resource_id str
    The OCID of the resource associated with a work request
    resource_type str
    Type of the resource associated with a work request
    statuses Sequence[str]
    A work request status to filter on. Can have multiple parameters of this name.
    compartmentId String
    The OCID of the compartment.
    clusterId String
    The OCID of the cluster.
    filters List<Property Map>
    resourceId String
    The OCID of the resource associated with a work request
    resourceType String
    Type of the resource associated with a work request
    statuses List<String>
    A work request status to filter on. Can have multiple parameters of this name.

    getWorkRequests Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment in which the work request exists.
    Id string
    The provider-assigned unique ID for this managed resource.
    WorkRequests List<GetWorkRequestsWorkRequest>
    The list of work_requests.
    ClusterId string
    Filters List<GetWorkRequestsFilter>
    ResourceId string
    ResourceType string
    Statuses List<string>
    The current status of the work request.
    CompartmentId string
    The OCID of the compartment in which the work request exists.
    Id string
    The provider-assigned unique ID for this managed resource.
    WorkRequests []GetWorkRequestsWorkRequest
    The list of work_requests.
    ClusterId string
    Filters []GetWorkRequestsFilter
    ResourceId string
    ResourceType string
    Statuses []string
    The current status of the work request.
    compartmentId String
    The OCID of the compartment in which the work request exists.
    id String
    The provider-assigned unique ID for this managed resource.
    workRequests List<GetWorkRequestsWorkRequest>
    The list of work_requests.
    clusterId String
    filters List<GetWorkRequestsFilter>
    resourceId String
    resourceType String
    statuses List<String>
    The current status of the work request.
    compartmentId string
    The OCID of the compartment in which the work request exists.
    id string
    The provider-assigned unique ID for this managed resource.
    workRequests GetWorkRequestsWorkRequest[]
    The list of work_requests.
    clusterId string
    filters GetWorkRequestsFilter[]
    resourceId string
    resourceType string
    statuses string[]
    The current status of the work request.
    compartment_id str
    The OCID of the compartment in which the work request exists.
    id str
    The provider-assigned unique ID for this managed resource.
    work_requests Sequence[containerengine.GetWorkRequestsWorkRequest]
    The list of work_requests.
    cluster_id str
    filters Sequence[containerengine.GetWorkRequestsFilter]
    resource_id str
    resource_type str
    statuses Sequence[str]
    The current status of the work request.
    compartmentId String
    The OCID of the compartment in which the work request exists.
    id String
    The provider-assigned unique ID for this managed resource.
    workRequests List<Property Map>
    The list of work_requests.
    clusterId String
    filters List<Property Map>
    resourceId String
    resourceType String
    statuses List<String>
    The current status of the work request.

    Supporting Types

    GetWorkRequestsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetWorkRequestsWorkRequest

    CompartmentId string
    The OCID of the compartment.
    Id string
    The OCID of the work request.
    OperationType string
    The type of work the work request is doing.
    Resources List<GetWorkRequestsWorkRequestResource>
    The resources this work request affects.
    Status string
    A work request status to filter on. Can have multiple parameters of this name.
    TimeAccepted string
    The time the work request was accepted.
    TimeFinished string
    The time the work request was finished.
    TimeStarted string
    The time the work request was started.
    CompartmentId string
    The OCID of the compartment.
    Id string
    The OCID of the work request.
    OperationType string
    The type of work the work request is doing.
    Resources []GetWorkRequestsWorkRequestResource
    The resources this work request affects.
    Status string
    A work request status to filter on. Can have multiple parameters of this name.
    TimeAccepted string
    The time the work request was accepted.
    TimeFinished string
    The time the work request was finished.
    TimeStarted string
    The time the work request was started.
    compartmentId String
    The OCID of the compartment.
    id String
    The OCID of the work request.
    operationType String
    The type of work the work request is doing.
    resources List<GetWorkRequestsWorkRequestResource>
    The resources this work request affects.
    status String
    A work request status to filter on. Can have multiple parameters of this name.
    timeAccepted String
    The time the work request was accepted.
    timeFinished String
    The time the work request was finished.
    timeStarted String
    The time the work request was started.
    compartmentId string
    The OCID of the compartment.
    id string
    The OCID of the work request.
    operationType string
    The type of work the work request is doing.
    resources GetWorkRequestsWorkRequestResource[]
    The resources this work request affects.
    status string
    A work request status to filter on. Can have multiple parameters of this name.
    timeAccepted string
    The time the work request was accepted.
    timeFinished string
    The time the work request was finished.
    timeStarted string
    The time the work request was started.
    compartment_id str
    The OCID of the compartment.
    id str
    The OCID of the work request.
    operation_type str
    The type of work the work request is doing.
    resources Sequence[containerengine.GetWorkRequestsWorkRequestResource]
    The resources this work request affects.
    status str
    A work request status to filter on. Can have multiple parameters of this name.
    time_accepted str
    The time the work request was accepted.
    time_finished str
    The time the work request was finished.
    time_started str
    The time the work request was started.
    compartmentId String
    The OCID of the compartment.
    id String
    The OCID of the work request.
    operationType String
    The type of work the work request is doing.
    resources List<Property Map>
    The resources this work request affects.
    status String
    A work request status to filter on. Can have multiple parameters of this name.
    timeAccepted String
    The time the work request was accepted.
    timeFinished String
    The time the work request was finished.
    timeStarted String
    The time the work request was started.

    GetWorkRequestsWorkRequestResource

    ActionType string
    The way in which this resource was affected by the work tracked by the work request.
    EntityType string
    The resource type the work request affects.
    EntityUri string
    The URI path on which the user can issue a GET request to access the resource metadata.
    Identifier string
    The OCID of the resource the work request affects.
    ActionType string
    The way in which this resource was affected by the work tracked by the work request.
    EntityType string
    The resource type the work request affects.
    EntityUri string
    The URI path on which the user can issue a GET request to access the resource metadata.
    Identifier string
    The OCID of the resource the work request affects.
    actionType String
    The way in which this resource was affected by the work tracked by the work request.
    entityType String
    The resource type the work request affects.
    entityUri String
    The URI path on which the user can issue a GET request to access the resource metadata.
    identifier String
    The OCID of the resource the work request affects.
    actionType string
    The way in which this resource was affected by the work tracked by the work request.
    entityType string
    The resource type the work request affects.
    entityUri string
    The URI path on which the user can issue a GET request to access the resource metadata.
    identifier string
    The OCID of the resource the work request affects.
    action_type str
    The way in which this resource was affected by the work tracked by the work request.
    entity_type str
    The resource type the work request affects.
    entity_uri str
    The URI path on which the user can issue a GET request to access the resource metadata.
    identifier str
    The OCID of the resource the work request affects.
    actionType String
    The way in which this resource was affected by the work tracked by the work request.
    entityType String
    The resource type the work request affects.
    entityUri String
    The URI path on which the user can issue a GET request to access the resource metadata.
    identifier String
    The OCID of the resource the work request affects.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi