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

nomad.getScalingPolicies

Explore with Pulumi AI

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",
});
Copy
import pulumi
import pulumi_nomad as nomad

example = nomad.get_scaling_policies(job_id="webapp",
    type="horizontal")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: nomad:getScalingPolicies
      arguments:
        jobId: webapp
        type: horizontal
Copy

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>
Copy
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]
Copy
func GetScalingPolicies(ctx *Context, args *GetScalingPoliciesArgs, opts ...InvokeOption) (*GetScalingPoliciesResult, error)
func GetScalingPoliciesOutput(ctx *Context, args *GetScalingPoliciesOutputArgs, opts ...InvokeOption) GetScalingPoliciesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetScalingPoliciesResult> getScalingPolicies(GetScalingPoliciesArgs args, InvokeOptions options)
public static Output<GetScalingPoliciesResult> getScalingPolicies(GetScalingPoliciesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: nomad:index/getScalingPolicies:getScalingPolicies
  arguments:
    # arguments dictionary
Copy

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