HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

getScalingPolicies

Retrieve a list of Scaling Policies.

Example Usage

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Nomad.GetScalingPolicies.InvokeAsync(new Nomad.GetScalingPoliciesArgs
        {
            JobId = "webapp",
            Type = "horizontal",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "webapp"
		opt1 := "horizontal"
		_, err := nomad.GetScalingPolicies(ctx, &GetScalingPoliciesArgs{
			JobId: &opt0,
			Type:  &opt1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_nomad as nomad

example = nomad.get_scaling_policies(job_id="webapp",
    type="horizontal")
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const example = pulumi.output(nomad.getScalingPolicies({
    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)
}

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.
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.

getScalingPolicies Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Policies List<GetScalingPoliciesPolicy>
JobId string
Type string
Id string
The provider-assigned unique ID for this managed resource.
Policies []GetScalingPoliciesPolicy
JobId string
Type string
id string
The provider-assigned unique ID for this managed resource.
policies GetScalingPoliciesPolicy[]
jobId string
type string
id str
The provider-assigned unique ID for this managed resource.
policies Sequence[GetScalingPoliciesPolicy]
job_id str
type str

Supporting Types

GetScalingPoliciesPolicy

Enabled bool
Id string
Target Dictionary<string, object>
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
Id string
Target map[string]interface{}
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
id string
target {[key: string]: any}
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
id str
target Mapping[str, Any]
type str
(string) - An optional string to filter scaling policies based on policy type. If not provided, policies of all types are returned.

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.