mso 1.4.0 published on Monday, Apr 14, 2025 by ciscodevnet
mso.getTemplate
Explore with Pulumi AI
Data source for MSO Template.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mso from "@pulumi/mso";
const exampleWithName = mso.getTemplate({
templateName: "tenant_template",
templateType: "tenant",
});
const exampleWithId = mso.getTemplate({
templateId: "6718b46395400f3759523378",
});
import pulumi
import pulumi_mso as mso
example_with_name = mso.get_template(template_name="tenant_template",
template_type="tenant")
example_with_id = mso.get_template(template_id="6718b46395400f3759523378")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/mso/mso"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mso.LookupTemplate(ctx, &mso.LookupTemplateArgs{
TemplateName: pulumi.StringRef("tenant_template"),
TemplateType: pulumi.StringRef("tenant"),
}, nil)
if err != nil {
return err
}
_, err = mso.LookupTemplate(ctx, &mso.LookupTemplateArgs{
TemplateId: pulumi.StringRef("6718b46395400f3759523378"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mso = Pulumi.Mso;
return await Deployment.RunAsync(() =>
{
var exampleWithName = Mso.GetTemplate.Invoke(new()
{
TemplateName = "tenant_template",
TemplateType = "tenant",
});
var exampleWithId = Mso.GetTemplate.Invoke(new()
{
TemplateId = "6718b46395400f3759523378",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mso.MsoFunctions;
import com.pulumi.mso.inputs.GetTemplateArgs;
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 exampleWithName = MsoFunctions.getTemplate(GetTemplateArgs.builder()
.templateName("tenant_template")
.templateType("tenant")
.build());
final var exampleWithId = MsoFunctions.getTemplate(GetTemplateArgs.builder()
.templateId("6718b46395400f3759523378")
.build());
}
}
variables:
exampleWithName:
fn::invoke:
function: mso:getTemplate
arguments:
templateName: tenant_template
templateType: tenant
exampleWithId:
fn::invoke:
function: mso:getTemplate
arguments:
templateId: 6718b46395400f3759523378
Argument Reference
template_id
- (Optional) The ID of the template. Mutually exclusive withtemplate_name
.template_name
- (Optional) The name of the template. Mutually exclusive withtemplate_id
.template_type
- (Optional) The type of the template. Allowed values aretenant
,l3out
,fabric_policy
,fabric_resource
,monitoring_tenant
,monitoring_access
, orservice_device
. Required whentemplate_name
is provided.
Attribute Reference
tenant_id
- (Read-Only) The ID of the tenant associated with the template.sites
- (Read-Only) A list of site names associated with the template.
Using getTemplate
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 getTemplate(args: GetTemplateArgs, opts?: InvokeOptions): Promise<GetTemplateResult>
function getTemplateOutput(args: GetTemplateOutputArgs, opts?: InvokeOptions): Output<GetTemplateResult>
def get_template(id: Optional[str] = None,
template_id: Optional[str] = None,
template_name: Optional[str] = None,
template_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTemplateResult
def get_template_output(id: Optional[pulumi.Input[str]] = None,
template_id: Optional[pulumi.Input[str]] = None,
template_name: Optional[pulumi.Input[str]] = None,
template_type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTemplateResult]
func LookupTemplate(ctx *Context, args *LookupTemplateArgs, opts ...InvokeOption) (*LookupTemplateResult, error)
func LookupTemplateOutput(ctx *Context, args *LookupTemplateOutputArgs, opts ...InvokeOption) LookupTemplateResultOutput
> Note: This function is named LookupTemplate
in the Go SDK.
public static class GetTemplate
{
public static Task<GetTemplateResult> InvokeAsync(GetTemplateArgs args, InvokeOptions? opts = null)
public static Output<GetTemplateResult> Invoke(GetTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
public static Output<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
fn::invoke:
function: mso:index/getTemplate:getTemplate
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- Template
Id string - Template
Name string - Template
Type string
- Id string
- Template
Id string - Template
Name string - Template
Type string
- id String
- template
Id String - template
Name String - template
Type String
- id string
- template
Id string - template
Name string - template
Type string
- id str
- template_
id str - template_
name str - template_
type str
- id String
- template
Id String - template
Name String - template
Type String
getTemplate Result
The following output properties are available:
- Id string
- Sites List<string>
- Tenant
Id string - Template
Id string - Template
Name string - Template
Type string
- Id string
- Sites []string
- Tenant
Id string - Template
Id string - Template
Name string - Template
Type string
- id String
- sites List<String>
- tenant
Id String - template
Id String - template
Name String - template
Type String
- id string
- sites string[]
- tenant
Id string - template
Id string - template
Name string - template
Type string
- id str
- sites Sequence[str]
- tenant_
id str - template_
id str - template_
name str - template_
type str
- id String
- sites List<String>
- tenant
Id String - template
Id String - template
Name String - template
Type String
Package Details
- Repository
- mso ciscodevnet/terraform-provider-mso
- License
- Notes
- This Pulumi package is based on the
mso
Terraform Provider.