1. Packages
  2. Juniper Mist Provider
  3. API Docs
  4. org
  5. Apitoken
Juniper Mist v0.3.0 published on Wednesday, Apr 9, 2025 by Pulumi

junipermist.org.Apitoken

Explore with Pulumi AI

This resource manages Org API Tokens.

An Org API token is a unique identifier used by an application to authenticate and access the Mist APIs. These tokens are used to authenticate requests made to the API server and ensure secure access to the API. They are not bound to any specific user and provide access to the organization as a whole. Organization tokens support different privileges and can only be used for the specific organization they are generated for. Rate limiting is done on an individual token basis, so if one token reaches its rate limit, it does not impact other tokens.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  apitokenOne:
    type: junipermist:org:Apitoken
    name: apitoken_one
    properties:
      orgId: ${terraformTest.id}
      name: apitoken_one
      privileges:
        - scope: site
          role: admin
          site_id: d7c8364e-xxxx-xxxx-xxxx-37eff0475b03
        - scope: site
          role: read
          site_id: 08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4
      srcIps:
        - 1.2.3.4/32
Copy

Create Apitoken Resource

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

Constructor syntax

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

@overload
def Apitoken(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             org_id: Optional[str] = None,
             privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
             name: Optional[str] = None,
             src_ips: Optional[Sequence[str]] = None)
func NewApitoken(ctx *Context, name string, args ApitokenArgs, opts ...ResourceOption) (*Apitoken, error)
public Apitoken(string name, ApitokenArgs args, CustomResourceOptions? opts = null)
public Apitoken(String name, ApitokenArgs args)
public Apitoken(String name, ApitokenArgs args, CustomResourceOptions options)
type: junipermist:org:Apitoken
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. ApitokenArgs
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. ApitokenArgs
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. ApitokenArgs
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. ApitokenArgs
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. ApitokenArgs
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 apitokenResource = new JuniperMist.Org.Apitoken("apitokenResource", new()
{
    OrgId = "string",
    Privileges = new[]
    {
        new JuniperMist.Org.Inputs.ApitokenPrivilegeArgs
        {
            Role = "string",
            Scope = "string",
            SiteId = "string",
            SitegroupId = "string",
        },
    },
    Name = "string",
    SrcIps = new[]
    {
        "string",
    },
});
Copy
example, err := org.NewApitoken(ctx, "apitokenResource", &org.ApitokenArgs{
	OrgId: pulumi.String("string"),
	Privileges: org.ApitokenPrivilegeArray{
		&org.ApitokenPrivilegeArgs{
			Role:        pulumi.String("string"),
			Scope:       pulumi.String("string"),
			SiteId:      pulumi.String("string"),
			SitegroupId: pulumi.String("string"),
		},
	},
	Name: pulumi.String("string"),
	SrcIps: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var apitokenResource = new Apitoken("apitokenResource", ApitokenArgs.builder()
    .orgId("string")
    .privileges(ApitokenPrivilegeArgs.builder()
        .role("string")
        .scope("string")
        .siteId("string")
        .sitegroupId("string")
        .build())
    .name("string")
    .srcIps("string")
    .build());
Copy
apitoken_resource = junipermist.org.Apitoken("apitokenResource",
    org_id="string",
    privileges=[{
        "role": "string",
        "scope": "string",
        "site_id": "string",
        "sitegroup_id": "string",
    }],
    name="string",
    src_ips=["string"])
Copy
const apitokenResource = new junipermist.org.Apitoken("apitokenResource", {
    orgId: "string",
    privileges: [{
        role: "string",
        scope: "string",
        siteId: "string",
        sitegroupId: "string",
    }],
    name: "string",
    srcIps: ["string"],
});
Copy
type: junipermist:org:Apitoken
properties:
    name: string
    orgId: string
    privileges:
        - role: string
          scope: string
          siteId: string
          sitegroupId: string
    srcIps:
        - string
Copy

Apitoken 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 Apitoken resource accepts the following input properties:

OrgId This property is required. string
Privileges This property is required. List<Pulumi.JuniperMist.Org.Inputs.ApitokenPrivilege>
List of privileges the token has on the orgs/sites
Name string
Name of the token
SrcIps List<string>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
OrgId This property is required. string
Privileges This property is required. []ApitokenPrivilegeArgs
List of privileges the token has on the orgs/sites
Name string
Name of the token
SrcIps []string
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
orgId This property is required. String
privileges This property is required. List<ApitokenPrivilege>
List of privileges the token has on the orgs/sites
name String
Name of the token
srcIps List<String>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
orgId This property is required. string
privileges This property is required. ApitokenPrivilege[]
List of privileges the token has on the orgs/sites
name string
Name of the token
srcIps string[]
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
org_id This property is required. str
privileges This property is required. Sequence[ApitokenPrivilegeArgs]
List of privileges the token has on the orgs/sites
name str
Name of the token
src_ips Sequence[str]
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
orgId This property is required. String
privileges This property is required. List<Property Map>
List of privileges the token has on the orgs/sites
name String
Name of the token
srcIps List<String>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.

Outputs

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

CreatedBy string
email of the token creator / null if creator is deleted
Id string
The provider-assigned unique ID for this managed resource.
Key string
CreatedBy string
email of the token creator / null if creator is deleted
Id string
The provider-assigned unique ID for this managed resource.
Key string
createdBy String
email of the token creator / null if creator is deleted
id String
The provider-assigned unique ID for this managed resource.
key String
createdBy string
email of the token creator / null if creator is deleted
id string
The provider-assigned unique ID for this managed resource.
key string
created_by str
email of the token creator / null if creator is deleted
id str
The provider-assigned unique ID for this managed resource.
key str
createdBy String
email of the token creator / null if creator is deleted
id String
The provider-assigned unique ID for this managed resource.
key String

Look up Existing Apitoken Resource

Get an existing Apitoken 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?: ApitokenState, opts?: CustomResourceOptions): Apitoken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_by: Optional[str] = None,
        key: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
        src_ips: Optional[Sequence[str]] = None) -> Apitoken
func GetApitoken(ctx *Context, name string, id IDInput, state *ApitokenState, opts ...ResourceOption) (*Apitoken, error)
public static Apitoken Get(string name, Input<string> id, ApitokenState? state, CustomResourceOptions? opts = null)
public static Apitoken get(String name, Output<String> id, ApitokenState state, CustomResourceOptions options)
resources:  _:    type: junipermist:org:Apitoken    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:
CreatedBy string
email of the token creator / null if creator is deleted
Key string
Name string
Name of the token
OrgId string
Privileges List<Pulumi.JuniperMist.Org.Inputs.ApitokenPrivilege>
List of privileges the token has on the orgs/sites
SrcIps List<string>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
CreatedBy string
email of the token creator / null if creator is deleted
Key string
Name string
Name of the token
OrgId string
Privileges []ApitokenPrivilegeArgs
List of privileges the token has on the orgs/sites
SrcIps []string
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
createdBy String
email of the token creator / null if creator is deleted
key String
name String
Name of the token
orgId String
privileges List<ApitokenPrivilege>
List of privileges the token has on the orgs/sites
srcIps List<String>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
createdBy string
email of the token creator / null if creator is deleted
key string
name string
Name of the token
orgId string
privileges ApitokenPrivilege[]
List of privileges the token has on the orgs/sites
srcIps string[]
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
created_by str
email of the token creator / null if creator is deleted
key str
name str
Name of the token
org_id str
privileges Sequence[ApitokenPrivilegeArgs]
List of privileges the token has on the orgs/sites
src_ips Sequence[str]
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
createdBy String
email of the token creator / null if creator is deleted
key String
name String
Name of the token
orgId String
privileges List<Property Map>
List of privileges the token has on the orgs/sites
srcIps List<String>
List of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.

Supporting Types

ApitokenPrivilege
, ApitokenPrivilegeArgs

Role This property is required. string
access permissions. enum: admin, helpdesk, installer, read, write
Scope This property is required. string
enum: org, site, sitegroup
SiteId string
Required if scope==site
SitegroupId string
Required if scope==sitegroup
Role This property is required. string
access permissions. enum: admin, helpdesk, installer, read, write
Scope This property is required. string
enum: org, site, sitegroup
SiteId string
Required if scope==site
SitegroupId string
Required if scope==sitegroup
role This property is required. String
access permissions. enum: admin, helpdesk, installer, read, write
scope This property is required. String
enum: org, site, sitegroup
siteId String
Required if scope==site
sitegroupId String
Required if scope==sitegroup
role This property is required. string
access permissions. enum: admin, helpdesk, installer, read, write
scope This property is required. string
enum: org, site, sitegroup
siteId string
Required if scope==site
sitegroupId string
Required if scope==sitegroup
role This property is required. str
access permissions. enum: admin, helpdesk, installer, read, write
scope This property is required. str
enum: org, site, sitegroup
site_id str
Required if scope==site
sitegroup_id str
Required if scope==sitegroup
role This property is required. String
access permissions. enum: admin, helpdesk, installer, read, write
scope This property is required. String
enum: org, site, sitegroup
siteId String
Required if scope==site
sitegroupId String
Required if scope==sitegroup

Package Details

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