1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ehpc
  5. getJobTemplates
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.ehpc.getJobTemplates

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    This data source provides the Ehpc Job Templates of the current Alibaba Cloud user.

    NOTE: Available in v1.133.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.ehpc.JobTemplate("default", {
        jobTemplateName: "example_value",
        commandLine: "./LammpsTest/lammps.pbs",
    });
    const ids = alicloud.ehpc.getJobTemplatesOutput({
        ids: [_default.id],
    });
    export const ehpcJobTemplateId1 = ids.apply(ids => ids.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ehpc.JobTemplate("default",
        job_template_name="example_value",
        command_line="./LammpsTest/lammps.pbs")
    ids = alicloud.ehpc.get_job_templates_output(ids=[default.id])
    pulumi.export("ehpcJobTemplateId1", ids.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ehpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ehpc.NewJobTemplate(ctx, "default", &ehpc.JobTemplateArgs{
    			JobTemplateName: pulumi.String("example_value"),
    			CommandLine:     pulumi.String("./LammpsTest/lammps.pbs"),
    		})
    		if err != nil {
    			return err
    		}
    		ids := ehpc.GetJobTemplatesOutput(ctx, ehpc.GetJobTemplatesOutputArgs{
    			Ids: pulumi.StringArray{
    				_default.ID(),
    			},
    		}, nil)
    		ctx.Export("ehpcJobTemplateId1", ids.ApplyT(func(ids ehpc.GetJobTemplatesResult) (*string, error) {
    			return &ids.Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Ehpc.JobTemplate("default", new()
        {
            JobTemplateName = "example_value",
            CommandLine = "./LammpsTest/lammps.pbs",
        });
    
        var ids = AliCloud.Ehpc.GetJobTemplates.Invoke(new()
        {
            Ids = new[]
            {
                @default.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["ehpcJobTemplateId1"] = ids.Apply(getJobTemplatesResult => getJobTemplatesResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ehpc.JobTemplate;
    import com.pulumi.alicloud.ehpc.JobTemplateArgs;
    import com.pulumi.alicloud.ehpc.EhpcFunctions;
    import com.pulumi.alicloud.ehpc.inputs.GetJobTemplatesArgs;
    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) {
            var default_ = new JobTemplate("default", JobTemplateArgs.builder()        
                .jobTemplateName("example_value")
                .commandLine("./LammpsTest/lammps.pbs")
                .build());
    
            final var ids = EhpcFunctions.getJobTemplates(GetJobTemplatesArgs.builder()
                .ids(default_.id())
                .build());
    
            ctx.export("ehpcJobTemplateId1", ids.applyValue(getJobTemplatesResult -> getJobTemplatesResult).applyValue(ids -> ids.applyValue(getJobTemplatesResult -> getJobTemplatesResult.id())));
        }
    }
    
    resources:
      default:
        type: alicloud:ehpc:JobTemplate
        properties:
          jobTemplateName: example_value
          commandLine: ./LammpsTest/lammps.pbs
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ehpc:getJobTemplates
          Arguments:
            ids:
              - ${default.id}
    outputs:
      ehpcJobTemplateId1: ${ids.id}
    

    Using getJobTemplates

    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 getJobTemplates(args: GetJobTemplatesArgs, opts?: InvokeOptions): Promise<GetJobTemplatesResult>
    function getJobTemplatesOutput(args: GetJobTemplatesOutputArgs, opts?: InvokeOptions): Output<GetJobTemplatesResult>
    def get_job_templates(ids: Optional[Sequence[str]] = None,
                          output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetJobTemplatesResult
    def get_job_templates_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetJobTemplatesResult]
    func GetJobTemplates(ctx *Context, args *GetJobTemplatesArgs, opts ...InvokeOption) (*GetJobTemplatesResult, error)
    func GetJobTemplatesOutput(ctx *Context, args *GetJobTemplatesOutputArgs, opts ...InvokeOption) GetJobTemplatesResultOutput

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

    public static class GetJobTemplates 
    {
        public static Task<GetJobTemplatesResult> InvokeAsync(GetJobTemplatesArgs args, InvokeOptions? opts = null)
        public static Output<GetJobTemplatesResult> Invoke(GetJobTemplatesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetJobTemplatesResult> getJobTemplates(GetJobTemplatesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ehpc/getJobTemplates:getJobTemplates
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Job Template IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Job Template IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Job Template IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Job Template IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Job Template IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Job Template IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getJobTemplates Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Templates List<Pulumi.AliCloud.Ehpc.Outputs.GetJobTemplatesTemplate>
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Templates []GetJobTemplatesTemplate
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    templates List<GetJobTemplatesTemplate>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    templates GetJobTemplatesTemplate[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    templates Sequence[GetJobTemplatesTemplate]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    templates List<Property Map>
    outputFile String

    Supporting Types

    GetJobTemplatesTemplate

    ArrayRequest string
    Queue Jobs, Is of the Form: 1-10:2.
    ClockTime string
    Job Maximum Run Time.
    CommandLine string
    Job Commands.
    Gpu int
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    Id string
    The ID of the Job Template.
    JobTemplateId string
    The first ID of the resource.
    JobTemplateName string
    A Job Template Name.
    Mem string
    A Single Compute Node Maximum Memory.
    Node int
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    PackagePath string
    Job Commands the Directory.
    Priority int
    The Job Priority.Possible Values: 0~9.
    Queue string
    The Job Queue.
    ReRunable bool
    If the Job Is Support for the Re-Run.
    RunasUser string
    The name of the user who performed the job.
    StderrRedirectPath string
    Error Output Path.
    StdoutRedirectPath string
    Standard Output Path and.
    Task int
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    Thread int
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    Variables string
    The Job of the Environment Variable.
    ArrayRequest string
    Queue Jobs, Is of the Form: 1-10:2.
    ClockTime string
    Job Maximum Run Time.
    CommandLine string
    Job Commands.
    Gpu int
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    Id string
    The ID of the Job Template.
    JobTemplateId string
    The first ID of the resource.
    JobTemplateName string
    A Job Template Name.
    Mem string
    A Single Compute Node Maximum Memory.
    Node int
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    PackagePath string
    Job Commands the Directory.
    Priority int
    The Job Priority.Possible Values: 0~9.
    Queue string
    The Job Queue.
    ReRunable bool
    If the Job Is Support for the Re-Run.
    RunasUser string
    The name of the user who performed the job.
    StderrRedirectPath string
    Error Output Path.
    StdoutRedirectPath string
    Standard Output Path and.
    Task int
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    Thread int
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    Variables string
    The Job of the Environment Variable.
    arrayRequest String
    Queue Jobs, Is of the Form: 1-10:2.
    clockTime String
    Job Maximum Run Time.
    commandLine String
    Job Commands.
    gpu Integer
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    id String
    The ID of the Job Template.
    jobTemplateId String
    The first ID of the resource.
    jobTemplateName String
    A Job Template Name.
    mem String
    A Single Compute Node Maximum Memory.
    node Integer
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    packagePath String
    Job Commands the Directory.
    priority Integer
    The Job Priority.Possible Values: 0~9.
    queue String
    The Job Queue.
    reRunable Boolean
    If the Job Is Support for the Re-Run.
    runasUser String
    The name of the user who performed the job.
    stderrRedirectPath String
    Error Output Path.
    stdoutRedirectPath String
    Standard Output Path and.
    task Integer
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    thread Integer
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    variables String
    The Job of the Environment Variable.
    arrayRequest string
    Queue Jobs, Is of the Form: 1-10:2.
    clockTime string
    Job Maximum Run Time.
    commandLine string
    Job Commands.
    gpu number
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    id string
    The ID of the Job Template.
    jobTemplateId string
    The first ID of the resource.
    jobTemplateName string
    A Job Template Name.
    mem string
    A Single Compute Node Maximum Memory.
    node number
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    packagePath string
    Job Commands the Directory.
    priority number
    The Job Priority.Possible Values: 0~9.
    queue string
    The Job Queue.
    reRunable boolean
    If the Job Is Support for the Re-Run.
    runasUser string
    The name of the user who performed the job.
    stderrRedirectPath string
    Error Output Path.
    stdoutRedirectPath string
    Standard Output Path and.
    task number
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    thread number
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    variables string
    The Job of the Environment Variable.
    array_request str
    Queue Jobs, Is of the Form: 1-10:2.
    clock_time str
    Job Maximum Run Time.
    command_line str
    Job Commands.
    gpu int
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    id str
    The ID of the Job Template.
    job_template_id str
    The first ID of the resource.
    job_template_name str
    A Job Template Name.
    mem str
    A Single Compute Node Maximum Memory.
    node int
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    package_path str
    Job Commands the Directory.
    priority int
    The Job Priority.Possible Values: 0~9.
    queue str
    The Job Queue.
    re_runable bool
    If the Job Is Support for the Re-Run.
    runas_user str
    The name of the user who performed the job.
    stderr_redirect_path str
    Error Output Path.
    stdout_redirect_path str
    Standard Output Path and.
    task int
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    thread int
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    variables str
    The Job of the Environment Variable.
    arrayRequest String
    Queue Jobs, Is of the Form: 1-10:2.
    clockTime String
    Job Maximum Run Time.
    commandLine String
    Job Commands.
    gpu Number
    A Single Compute Node Using the GPU Number.Possible Values: 1~20000.
    id String
    The ID of the Job Template.
    jobTemplateId String
    The first ID of the resource.
    jobTemplateName String
    A Job Template Name.
    mem String
    A Single Compute Node Maximum Memory.
    node Number
    Submit a Task Is Required for Computing the Number of Data Nodes to Be. Possible Values: 1~5000 .
    packagePath String
    Job Commands the Directory.
    priority Number
    The Job Priority.Possible Values: 0~9.
    queue String
    The Job Queue.
    reRunable Boolean
    If the Job Is Support for the Re-Run.
    runasUser String
    The name of the user who performed the job.
    stderrRedirectPath String
    Error Output Path.
    stdoutRedirectPath String
    Standard Output Path and.
    task Number
    A Single Compute Node Required Number of Tasks. Possible Values: 1~20000 .
    thread Number
    A Single Task and the Number of Required Threads.Possible Values: 1~20000.
    variables String
    The Job of the Environment Variable.

    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.52.1 published on Thursday, Apr 4, 2024 by Pulumi