1. Packages
  2. Juniper Mist
  3. API Docs
  4. org
  5. Apitoken
Juniper Mist v0.1.1 published on Monday, Nov 4, 2024 by Pulumi

junipermist.org.Apitoken

Explore with Pulumi AI

junipermist logo
Juniper Mist v0.1.1 published on Monday, Nov 4, 2024 by Pulumi

    This resource manages Org API Tokens. Org API token is a unique identifier used by an application to authenticate and access a service’s API. 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!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.junipermist.org.Apitoken;
    import com.pulumi.junipermist.org.ApitokenArgs;
    import com.pulumi.junipermist.org.inputs.ApitokenPrivilegeArgs;
    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 apitokenOne = new Apitoken("apitokenOne", ApitokenArgs.builder()
                .orgId(terraformTest.id())
                .name("apitoken_one")
                .privileges(            
                    ApitokenPrivilegeArgs.builder()
                        .scope("site")
                        .role("admin")
                        .site_id("d7c8364e-xxxx-xxxx-xxxx-37eff0475b03")
                        .build(),
                    ApitokenPrivilegeArgs.builder()
                        .scope("site")
                        .role("read")
                        .site_id("08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4")
                        .build())
                .srcIps("1.2.3.4/32")
                .build());
    
        }
    }
    
    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
    

    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 string
    The unique name of the resource.
    args ApitokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args ApitokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApitokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
        },
    });
    
    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"),
    	},
    })
    
    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());
    
    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"])
    
    const apitokenResource = new junipermist.org.Apitoken("apitokenResource", {
        orgId: "string",
        privileges: [{
            role: "string",
            scope: "string",
            siteId: "string",
            sitegroupId: "string",
        }],
        name: "string",
        srcIps: ["string"],
    });
    
    type: junipermist:org:Apitoken
    properties:
        name: string
        orgId: string
        privileges:
            - role: string
              scope: string
              siteId: string
              sitegroupId: string
        srcIps:
            - string
    

    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 string
    Privileges 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 string
    Privileges []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 String
    privileges 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 string
    privileges 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 str
    privileges 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 String
    privileges 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 string
    access permissions. enum: admin, helpdesk, installer, read, write
    Scope string
    enum: org, site, sitegroup
    SiteId string
    Required if scope==site
    SitegroupId string
    Required if scope==sitegroup
    Role string
    access permissions. enum: admin, helpdesk, installer, read, write
    Scope string
    enum: org, site, sitegroup
    SiteId string
    Required if scope==site
    SitegroupId string
    Required if scope==sitegroup
    role String
    access permissions. enum: admin, helpdesk, installer, read, write
    scope String
    enum: org, site, sitegroup
    siteId String
    Required if scope==site
    sitegroupId String
    Required if scope==sitegroup
    role string
    access permissions. enum: admin, helpdesk, installer, read, write
    scope string
    enum: org, site, sitegroup
    siteId string
    Required if scope==site
    sitegroupId string
    Required if scope==sitegroup
    role str
    access permissions. enum: admin, helpdesk, installer, read, write
    scope str
    enum: org, site, sitegroup
    site_id str
    Required if scope==site
    sitegroup_id str
    Required if scope==sitegroup
    role String
    access permissions. enum: admin, helpdesk, installer, read, write
    scope 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.
    junipermist logo
    Juniper Mist v0.1.1 published on Monday, Nov 4, 2024 by Pulumi