1. Packages
  2. Nomad Provider
  3. API Docs
  4. getScalingPolicies
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

nomad.getScalingPolicies

Start a Neo task
Explain and create a nomad.getScalingPolicies resource
nomad logo
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

    Retrieve a list of Scaling Policies.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nomad from "@pulumi/nomad";
    
    const example = nomad.getScalingPolicies({
        jobId: "webapp",
        type: "horizontal",
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    example = nomad.get_scaling_policies(job_id="webapp",
        type="horizontal")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nomad.GetScalingPolicies(ctx, &nomad.GetScalingPoliciesArgs{
    			JobId: pulumi.StringRef("webapp"),
    			Type:  pulumi.StringRef("horizontal"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nomad = Pulumi.Nomad;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Nomad.GetScalingPolicies.Invoke(new()
        {
            JobId = "webapp",
            Type = "horizontal",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nomad.NomadFunctions;
    import com.pulumi.nomad.inputs.GetScalingPoliciesArgs;
    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 = NomadFunctions.getScalingPolicies(GetScalingPoliciesArgs.builder()
                .jobId("webapp")
                .type("horizontal")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: nomad:getScalingPolicies
          arguments:
            jobId: webapp
            type: horizontal
    

    Using getScalingPolicies

    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 getScalingPolicies(args: GetScalingPoliciesArgs, opts?: InvokeOptions): Promise<GetScalingPoliciesResult>
    function getScalingPoliciesOutput(args: GetScalingPoliciesOutputArgs, opts?: InvokeOptions): Output<GetScalingPoliciesResult>
    def get_scaling_policies(job_id: Optional[str] = None,
                             type: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetScalingPoliciesResult
    def get_scaling_policies_output(job_id: Optional[pulumi.Input[str]] = None,
                             type: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetScalingPoliciesResult]
    func GetScalingPolicies(ctx *Context, args *GetScalingPoliciesArgs, opts ...InvokeOption) (*GetScalingPoliciesResult, error)
    func GetScalingPoliciesOutput(ctx *Context, args *GetScalingPoliciesOutputArgs, opts ...InvokeOption) GetScalingPoliciesResultOutput

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

    public static class GetScalingPolicies 
    {
        public static Task<GetScalingPoliciesResult> InvokeAsync(GetScalingPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetScalingPoliciesResult> Invoke(GetScalingPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetScalingPoliciesResult> getScalingPolicies(GetScalingPoliciesArgs args, InvokeOptions options)
    public static Output<GetScalingPoliciesResult> getScalingPolicies(GetScalingPoliciesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nomad:index/getScalingPolicies:getScalingPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    JobId string
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    Type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    JobId string
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    Type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    jobId String
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    type String
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    jobId string
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    job_id str
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    type str
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    jobId String
    (string) - An optional string to filter scaling policies based on the target job. If not provided, policies for all jobs are returned.
    type String
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.

    getScalingPolicies Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Policies List<GetScalingPoliciesPolicy>
    list of maps - A list of scaling policies.
    JobId string
    Type string
    (string) - The scaling policy type.
    Id string
    The provider-assigned unique ID for this managed resource.
    Policies []GetScalingPoliciesPolicy
    list of maps - A list of scaling policies.
    JobId string
    Type string
    (string) - The scaling policy type.
    id String
    The provider-assigned unique ID for this managed resource.
    policies List<GetScalingPoliciesPolicy>
    list of maps - A list of scaling policies.
    jobId String
    type String
    (string) - The scaling policy type.
    id string
    The provider-assigned unique ID for this managed resource.
    policies GetScalingPoliciesPolicy[]
    list of maps - A list of scaling policies.
    jobId string
    type string
    (string) - The scaling policy type.
    id str
    The provider-assigned unique ID for this managed resource.
    policies Sequence[GetScalingPoliciesPolicy]
    list of maps - A list of scaling policies.
    job_id str
    type str
    (string) - The scaling policy type.
    id String
    The provider-assigned unique ID for this managed resource.
    policies List<Property Map>
    list of maps - A list of scaling policies.
    jobId String
    type String
    (string) - The scaling policy type.

    Supporting Types

    GetScalingPoliciesPolicy

    Enabled bool
    (boolean) - Whether or not the scaling policy is enabled.
    Id string
    (string) - The scaling policy ID.
    Target Dictionary<string, string>
    (map[string]string) - The scaling policy target.
    Type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    Enabled bool
    (boolean) - Whether or not the scaling policy is enabled.
    Id string
    (string) - The scaling policy ID.
    Target map[string]string
    (map[string]string) - The scaling policy target.
    Type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    enabled Boolean
    (boolean) - Whether or not the scaling policy is enabled.
    id String
    (string) - The scaling policy ID.
    target Map<String,String>
    (map[string]string) - The scaling policy target.
    type String
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    enabled boolean
    (boolean) - Whether or not the scaling policy is enabled.
    id string
    (string) - The scaling policy ID.
    target {[key: string]: string}
    (map[string]string) - The scaling policy target.
    type string
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    enabled bool
    (boolean) - Whether or not the scaling policy is enabled.
    id str
    (string) - The scaling policy ID.
    target Mapping[str, str]
    (map[string]string) - The scaling policy target.
    type str
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.
    enabled Boolean
    (boolean) - Whether or not the scaling policy is enabled.
    id String
    (string) - The scaling policy ID.
    target Map<String>
    (map[string]string) - The scaling policy target.
    type String
    (string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.

    Package Details

    Repository
    HashiCorp Nomad pulumi/pulumi-nomad
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nomad Terraform Provider.
    nomad logo
    Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate