1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. actiontrail
  5. getHistoryDeliveryJobs
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.actiontrail.getHistoryDeliveryJobs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Actiontrail History Delivery Jobs of the current Alibaba Cloud user.

    NOTE: Available in v1.139.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.actiontrail.getHistoryDeliveryJobs({
        ids: ["example_id"],
    });
    export const actiontrailHistoryDeliveryJobId1 = ids.then(ids => ids.jobs?.[0]?.id);
    const status = alicloud.actiontrail.getHistoryDeliveryJobs({
        ids: ["example_id"],
        status: 2,
    });
    export const actiontrailHistoryDeliveryJobId2 = status.then(status => status.jobs?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.actiontrail.get_history_delivery_jobs(ids=["example_id"])
    pulumi.export("actiontrailHistoryDeliveryJobId1", ids.jobs[0].id)
    status = alicloud.actiontrail.get_history_delivery_jobs(ids=["example_id"],
        status=2)
    pulumi.export("actiontrailHistoryDeliveryJobId2", status.jobs[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := actiontrail.GetHistoryDeliveryJobs(ctx, &actiontrail.GetHistoryDeliveryJobsArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("actiontrailHistoryDeliveryJobId1", ids.Jobs[0].Id)
    		status, err := actiontrail.GetHistoryDeliveryJobs(ctx, &actiontrail.GetHistoryDeliveryJobsArgs{
    			Ids: []string{
    				"example_id",
    			},
    			Status: pulumi.IntRef(2),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("actiontrailHistoryDeliveryJobId2", status.Jobs[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.ActionTrail.GetHistoryDeliveryJobs.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var status = AliCloud.ActionTrail.GetHistoryDeliveryJobs.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
            Status = 2,
        });
    
        return new Dictionary<string, object?>
        {
            ["actiontrailHistoryDeliveryJobId1"] = ids.Apply(getHistoryDeliveryJobsResult => getHistoryDeliveryJobsResult.Jobs[0]?.Id),
            ["actiontrailHistoryDeliveryJobId2"] = status.Apply(getHistoryDeliveryJobsResult => getHistoryDeliveryJobsResult.Jobs[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.actiontrail.ActiontrailFunctions;
    import com.pulumi.alicloud.actiontrail.inputs.GetHistoryDeliveryJobsArgs;
    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 ids = ActiontrailFunctions.getHistoryDeliveryJobs(GetHistoryDeliveryJobsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("actiontrailHistoryDeliveryJobId1", ids.applyValue(getHistoryDeliveryJobsResult -> getHistoryDeliveryJobsResult.jobs()[0].id()));
            final var status = ActiontrailFunctions.getHistoryDeliveryJobs(GetHistoryDeliveryJobsArgs.builder()
                .ids("example_id")
                .status("2")
                .build());
    
            ctx.export("actiontrailHistoryDeliveryJobId2", status.applyValue(getHistoryDeliveryJobsResult -> getHistoryDeliveryJobsResult.jobs()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:actiontrail:getHistoryDeliveryJobs
          Arguments:
            ids:
              - example_id
      status:
        fn::invoke:
          Function: alicloud:actiontrail:getHistoryDeliveryJobs
          Arguments:
            ids:
              - example_id
            status: '2'
    outputs:
      actiontrailHistoryDeliveryJobId1: ${ids.jobs[0].id}
      actiontrailHistoryDeliveryJobId2: ${status.jobs[0].id}
    

    Using getHistoryDeliveryJobs

    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 getHistoryDeliveryJobs(args: GetHistoryDeliveryJobsArgs, opts?: InvokeOptions): Promise<GetHistoryDeliveryJobsResult>
    function getHistoryDeliveryJobsOutput(args: GetHistoryDeliveryJobsOutputArgs, opts?: InvokeOptions): Output<GetHistoryDeliveryJobsResult>
    def get_history_delivery_jobs(enable_details: Optional[bool] = None,
                                  ids: Optional[Sequence[str]] = None,
                                  output_file: Optional[str] = None,
                                  status: Optional[int] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetHistoryDeliveryJobsResult
    def get_history_delivery_jobs_output(enable_details: Optional[pulumi.Input[bool]] = None,
                                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  output_file: Optional[pulumi.Input[str]] = None,
                                  status: Optional[pulumi.Input[int]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetHistoryDeliveryJobsResult]
    func GetHistoryDeliveryJobs(ctx *Context, args *GetHistoryDeliveryJobsArgs, opts ...InvokeOption) (*GetHistoryDeliveryJobsResult, error)
    func GetHistoryDeliveryJobsOutput(ctx *Context, args *GetHistoryDeliveryJobsOutputArgs, opts ...InvokeOption) GetHistoryDeliveryJobsResultOutput

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

    public static class GetHistoryDeliveryJobs 
    {
        public static Task<GetHistoryDeliveryJobsResult> InvokeAsync(GetHistoryDeliveryJobsArgs args, InvokeOptions? opts = null)
        public static Output<GetHistoryDeliveryJobsResult> Invoke(GetHistoryDeliveryJobsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHistoryDeliveryJobsResult> getHistoryDeliveryJobs(GetHistoryDeliveryJobsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:actiontrail/getHistoryDeliveryJobs:getHistoryDeliveryJobs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Ids List<string>
    A list of History Delivery Job IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    EnableDetails bool
    Ids []string
    A list of History Delivery Job IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    enableDetails Boolean
    ids List<String>
    A list of History Delivery Job IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Integer
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    enableDetails boolean
    ids string[]
    A list of History Delivery Job IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    enable_details bool
    ids Sequence[str]
    A list of History Delivery Job IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    enableDetails Boolean
    ids List<String>
    A list of History Delivery Job IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.

    getHistoryDeliveryJobs Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Jobs List<Pulumi.AliCloud.ActionTrail.Outputs.GetHistoryDeliveryJobsJob>
    EnableDetails bool
    OutputFile string
    Status int
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Jobs []GetHistoryDeliveryJobsJob
    EnableDetails bool
    OutputFile string
    Status int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    jobs List<GetHistoryDeliveryJobsJob>
    enableDetails Boolean
    outputFile String
    status Integer
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    jobs GetHistoryDeliveryJobsJob[]
    enableDetails boolean
    outputFile string
    status number
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    jobs Sequence[GetHistoryDeliveryJobsJob]
    enable_details bool
    output_file str
    status int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    jobs List<Property Map>
    enableDetails Boolean
    outputFile String
    status Number

    Supporting Types

    GetHistoryDeliveryJobsJob

    CreateTime string
    The time when the task was created.
    EndTime string
    The time when the task ended.
    HistoryDeliveryJobId string
    HomeRegion string
    The home region of the trail.
    Id string
    The ID of the History Delivery Job.
    JobStatuses List<Pulumi.AliCloud.ActionTrail.Inputs.GetHistoryDeliveryJobsJobJobStatus>
    Detail status of delivery job.
    StartTime string
    The time when the task started.
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    TrailName string
    The name of the trail.
    UpdatedTime string
    The time when the task was updated.
    CreateTime string
    The time when the task was created.
    EndTime string
    The time when the task ended.
    HistoryDeliveryJobId string
    HomeRegion string
    The home region of the trail.
    Id string
    The ID of the History Delivery Job.
    JobStatuses []GetHistoryDeliveryJobsJobJobStatus
    Detail status of delivery job.
    StartTime string
    The time when the task started.
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    TrailName string
    The name of the trail.
    UpdatedTime string
    The time when the task was updated.
    createTime String
    The time when the task was created.
    endTime String
    The time when the task ended.
    historyDeliveryJobId String
    homeRegion String
    The home region of the trail.
    id String
    The ID of the History Delivery Job.
    jobStatuses List<GetHistoryDeliveryJobsJobJobStatus>
    Detail status of delivery job.
    startTime String
    The time when the task started.
    status Integer
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    trailName String
    The name of the trail.
    updatedTime String
    The time when the task was updated.
    createTime string
    The time when the task was created.
    endTime string
    The time when the task ended.
    historyDeliveryJobId string
    homeRegion string
    The home region of the trail.
    id string
    The ID of the History Delivery Job.
    jobStatuses GetHistoryDeliveryJobsJobJobStatus[]
    Detail status of delivery job.
    startTime string
    The time when the task started.
    status number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    trailName string
    The name of the trail.
    updatedTime string
    The time when the task was updated.
    create_time str
    The time when the task was created.
    end_time str
    The time when the task ended.
    history_delivery_job_id str
    home_region str
    The home region of the trail.
    id str
    The ID of the History Delivery Job.
    job_statuses Sequence[GetHistoryDeliveryJobsJobJobStatus]
    Detail status of delivery job.
    start_time str
    The time when the task started.
    status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    trail_name str
    The name of the trail.
    updated_time str
    The time when the task was updated.
    createTime String
    The time when the task was created.
    endTime String
    The time when the task ended.
    historyDeliveryJobId String
    homeRegion String
    The home region of the trail.
    id String
    The ID of the History Delivery Job.
    jobStatuses List<Property Map>
    Detail status of delivery job.
    startTime String
    The time when the task started.
    status Number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    trailName String
    The name of the trail.
    updatedTime String
    The time when the task was updated.

    GetHistoryDeliveryJobsJobJobStatus

    Region string
    The region of the delivery job.
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    Region string
    The region of the delivery job.
    Status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    region String
    The region of the delivery job.
    status Integer
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    region string
    The region of the delivery job.
    status number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    region str
    The region of the delivery job.
    status int
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.
    region String
    The region of the delivery job.
    status Number
    The status of the task. Valid values: 0, 1, 2, 3. 0: The task is initializing. 1: The task is delivering historical events. 2: The delivery of historical events is complete. 3: The task fails.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi