1. Packages
  2. Cisco NX OS Resource Provider
  3. API Docs
  4. Rest
Cisco NX-OS v0.0.2 published on Friday, Sep 29, 2023 by lbrlabs

nxos.Rest

Explore with Pulumi AI

Manages NX-OS DME Objects via REST API calls. This resource can manage a single API object and its children. It is able to read the state and therefore reconcile configuration drift.

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nxos.Rest;
import com.pulumi.nxos.RestArgs;
import com.pulumi.nxos.inputs.RestChildrenArgs;
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 l1PhysIf = new Rest("l1PhysIf", RestArgs.builder()        
            .className("l1PhysIf")
            .content(Map.ofEntries(
                Map.entry("id", "eth1/1"),
                Map.entry("mode", "trunk")
            ))
            .dn("sys/intf/phys-[eth1/1]")
            .build());

        var ipqosCMapInst = new Rest("ipqosCMapInst", RestArgs.builder()        
            .childrens(RestChildrenArgs.builder()
                .class_name("ipqosDscp")
                .content(Map.of("val", "ef"))
                .rn("dscp-ef")
                .build())
            .className("ipqosCMapInst")
            .content(Map.of("name", "CM1"))
            .dn("sys/ipqos/dflt/c/name-[CM1]")
            .build());

    }
}
Copy

Coming soon!

Coming soon!

resources:
  l1PhysIf:
    type: nxos:Rest
    properties:
      className: l1PhysIf
      content:
        id: eth1/1
        mode: trunk
      dn: sys/intf/phys-[eth1/1]
  ipqosCMapInst:
    type: nxos:Rest
    properties:
      childrens:
        - class_name: ipqosDscp
          content:
            - val: ef
          rn: dscp-ef
      className: ipqosCMapInst
      content:
        name: CM1
      dn: sys/ipqos/dflt/c/name-[CM1]
Copy

Create Rest Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Rest(name: string, args: RestArgs, opts?: CustomResourceOptions);
@overload
def Rest(resource_name: str,
         args: RestArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def Rest(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         class_name: Optional[str] = None,
         dn: Optional[str] = None,
         childrens: Optional[Sequence[RestChildrenArgs]] = None,
         content: Optional[Mapping[str, str]] = None,
         delete: Optional[bool] = None,
         device: Optional[str] = None)
func NewRest(ctx *Context, name string, args RestArgs, opts ...ResourceOption) (*Rest, error)
public Rest(string name, RestArgs args, CustomResourceOptions? opts = null)
public Rest(String name, RestArgs args)
public Rest(String name, RestArgs args, CustomResourceOptions options)
type: nxos:Rest
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RestArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RestArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RestArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RestArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RestArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var restResource = new Nxos.Rest("restResource", new()
{
    ClassName = "string",
    Dn = "string",
    Childrens = new[]
    {
        new Nxos.Inputs.RestChildrenArgs
        {
            ClassName = "string",
            Rn = "string",
            Content = 
            {
                { "string", "string" },
            },
        },
    },
    Content = 
    {
        { "string", "string" },
    },
    Delete = false,
    Device = "string",
});
Copy
example, err := nxos.NewRest(ctx, "restResource", &nxos.RestArgs{
	ClassName: pulumi.String("string"),
	Dn:        pulumi.String("string"),
	Childrens: nxos.RestChildrenArray{
		&nxos.RestChildrenArgs{
			ClassName: pulumi.String("string"),
			Rn:        pulumi.String("string"),
			Content: pulumi.StringMap{
				"string": pulumi.String("string"),
			},
		},
	},
	Content: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Delete: pulumi.Bool(false),
	Device: pulumi.String("string"),
})
Copy
var restResource = new Rest("restResource", RestArgs.builder()
    .className("string")
    .dn("string")
    .childrens(RestChildrenArgs.builder()
        .className("string")
        .rn("string")
        .content(Map.of("string", "string"))
        .build())
    .content(Map.of("string", "string"))
    .delete(false)
    .device("string")
    .build());
Copy
rest_resource = nxos.Rest("restResource",
    class_name="string",
    dn="string",
    childrens=[{
        "class_name": "string",
        "rn": "string",
        "content": {
            "string": "string",
        },
    }],
    content={
        "string": "string",
    },
    delete=False,
    device="string")
Copy
const restResource = new nxos.Rest("restResource", {
    className: "string",
    dn: "string",
    childrens: [{
        className: "string",
        rn: "string",
        content: {
            string: "string",
        },
    }],
    content: {
        string: "string",
    },
    "delete": false,
    device: "string",
});
Copy
type: nxos:Rest
properties:
    childrens:
        - className: string
          content:
            string: string
          rn: string
    className: string
    content:
        string: string
    delete: false
    device: string
    dn: string
Copy

Rest Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Rest resource accepts the following input properties:

ClassName This property is required. string
Which class object is being created. (Make sure there is no colon in the classname)
Dn This property is required. string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
Childrens List<Lbrlabs.PulumiPackage.Nxos.Inputs.RestChildren>
List of children.
Content Dictionary<string, string>
Map of key-value pairs that need to be passed to the Model object as parameters.
Delete bool
Delete object during destroy operation. Default value is true.
Device string
A device name from the provider configuration.
ClassName This property is required. string
Which class object is being created. (Make sure there is no colon in the classname)
Dn This property is required. string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
Childrens []RestChildrenArgs
List of children.
Content map[string]string
Map of key-value pairs that need to be passed to the Model object as parameters.
Delete bool
Delete object during destroy operation. Default value is true.
Device string
A device name from the provider configuration.
className This property is required. String
Which class object is being created. (Make sure there is no colon in the classname)
dn This property is required. String
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens List<RestChildren>
List of children.
content Map<String,String>
Map of key-value pairs that need to be passed to the Model object as parameters.
delete Boolean
Delete object during destroy operation. Default value is true.
device String
A device name from the provider configuration.
className This property is required. string
Which class object is being created. (Make sure there is no colon in the classname)
dn This property is required. string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens RestChildren[]
List of children.
content {[key: string]: string}
Map of key-value pairs that need to be passed to the Model object as parameters.
delete boolean
Delete object during destroy operation. Default value is true.
device string
A device name from the provider configuration.
class_name This property is required. str
Which class object is being created. (Make sure there is no colon in the classname)
dn This property is required. str
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens Sequence[RestChildrenArgs]
List of children.
content Mapping[str, str]
Map of key-value pairs that need to be passed to the Model object as parameters.
delete bool
Delete object during destroy operation. Default value is true.
device str
A device name from the provider configuration.
className This property is required. String
Which class object is being created. (Make sure there is no colon in the classname)
dn This property is required. String
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens List<Property Map>
List of children.
content Map<String>
Map of key-value pairs that need to be passed to the Model object as parameters.
delete Boolean
Delete object during destroy operation. Default value is true.
device String
A device name from the provider configuration.

Outputs

All input properties are implicitly available as output properties. Additionally, the Rest resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Rest Resource

Get an existing Rest resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RestState, opts?: CustomResourceOptions): Rest
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        childrens: Optional[Sequence[RestChildrenArgs]] = None,
        class_name: Optional[str] = None,
        content: Optional[Mapping[str, str]] = None,
        delete: Optional[bool] = None,
        device: Optional[str] = None,
        dn: Optional[str] = None) -> Rest
func GetRest(ctx *Context, name string, id IDInput, state *RestState, opts ...ResourceOption) (*Rest, error)
public static Rest Get(string name, Input<string> id, RestState? state, CustomResourceOptions? opts = null)
public static Rest get(String name, Output<String> id, RestState state, CustomResourceOptions options)
resources:  _:    type: nxos:Rest    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Childrens List<Lbrlabs.PulumiPackage.Nxos.Inputs.RestChildren>
List of children.
ClassName string
Which class object is being created. (Make sure there is no colon in the classname)
Content Dictionary<string, string>
Map of key-value pairs that need to be passed to the Model object as parameters.
Delete bool
Delete object during destroy operation. Default value is true.
Device string
A device name from the provider configuration.
Dn string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
Childrens []RestChildrenArgs
List of children.
ClassName string
Which class object is being created. (Make sure there is no colon in the classname)
Content map[string]string
Map of key-value pairs that need to be passed to the Model object as parameters.
Delete bool
Delete object during destroy operation. Default value is true.
Device string
A device name from the provider configuration.
Dn string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens List<RestChildren>
List of children.
className String
Which class object is being created. (Make sure there is no colon in the classname)
content Map<String,String>
Map of key-value pairs that need to be passed to the Model object as parameters.
delete Boolean
Delete object during destroy operation. Default value is true.
device String
A device name from the provider configuration.
dn String
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens RestChildren[]
List of children.
className string
Which class object is being created. (Make sure there is no colon in the classname)
content {[key: string]: string}
Map of key-value pairs that need to be passed to the Model object as parameters.
delete boolean
Delete object during destroy operation. Default value is true.
device string
A device name from the provider configuration.
dn string
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens Sequence[RestChildrenArgs]
List of children.
class_name str
Which class object is being created. (Make sure there is no colon in the classname)
content Mapping[str, str]
Map of key-value pairs that need to be passed to the Model object as parameters.
delete bool
Delete object during destroy operation. Default value is true.
device str
A device name from the provider configuration.
dn str
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].
childrens List<Property Map>
List of children.
className String
Which class object is being created. (Make sure there is no colon in the classname)
content Map<String>
Map of key-value pairs that need to be passed to the Model object as parameters.
delete Boolean
Delete object during destroy operation. Default value is true.
device String
A device name from the provider configuration.
dn String
Distinguished name of object being managed including its relative name, e.g. sys/intf/phys-[eth1/1].

Supporting Types

RestChildren
, RestChildrenArgs

ClassName This property is required. string
Class name of the child object.
Rn This property is required. string
The relative name of the child object.
Content Dictionary<string, string>
Map of key-value pairs which represents the attributes of the child object.
ClassName This property is required. string
Class name of the child object.
Rn This property is required. string
The relative name of the child object.
Content map[string]string
Map of key-value pairs which represents the attributes of the child object.
className This property is required. String
Class name of the child object.
rn This property is required. String
The relative name of the child object.
content Map<String,String>
Map of key-value pairs which represents the attributes of the child object.
className This property is required. string
Class name of the child object.
rn This property is required. string
The relative name of the child object.
content {[key: string]: string}
Map of key-value pairs which represents the attributes of the child object.
class_name This property is required. str
Class name of the child object.
rn This property is required. str
The relative name of the child object.
content Mapping[str, str]
Map of key-value pairs which represents the attributes of the child object.
className This property is required. String
Class name of the child object.
rn This property is required. String
The relative name of the child object.
content Map<String>
Map of key-value pairs which represents the attributes of the child object.

Import

 $ pulumi import nxos:index/rest:Rest l1PhysIf" "l1PhysIf:sys/intf/phys-[eth1/1]"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
nxos lbrlabs/pulumi-nxos
License
Apache-2.0
Notes
This Pulumi package is based on the nxos Terraform Provider.