1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. getToken
Harness v0.4.1 published on Monday, Oct 14, 2024 by Pulumi

harness.platform.getToken

Explore with Pulumi AI

harness logo
Harness v0.4.1 published on Monday, Oct 14, 2024 by Pulumi

    Data source for retrieving a Harness ApiKey Token.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const test = harness.platform.getToken({
        identifier: "test_token",
        parentId: "apikey_parent_id",
        orgId: "org_id",
        projectId: "project_id",
        apikeyId: "apikey_id",
        apikeyType: "USER",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    test = harness.platform.get_token(identifier="test_token",
        parent_id="apikey_parent_id",
        org_id="org_id",
        project_id="project_id",
        apikey_id="apikey_id",
        apikey_type="USER")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.LookupToken(ctx, &platform.LookupTokenArgs{
    			Identifier: "test_token",
    			ParentId:   "apikey_parent_id",
    			OrgId:      pulumi.StringRef("org_id"),
    			ProjectId:  pulumi.StringRef("project_id"),
    			ApikeyId:   "apikey_id",
    			ApikeyType: "USER",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Harness.Platform.GetToken.Invoke(new()
        {
            Identifier = "test_token",
            ParentId = "apikey_parent_id",
            OrgId = "org_id",
            ProjectId = "project_id",
            ApikeyId = "apikey_id",
            ApikeyType = "USER",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.PlatformFunctions;
    import com.pulumi.harness.platform.inputs.GetTokenArgs;
    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 test = PlatformFunctions.getToken(GetTokenArgs.builder()
                .identifier("test_token")
                .parentId("apikey_parent_id")
                .orgId("org_id")
                .projectId("project_id")
                .apikeyId("apikey_id")
                .apikeyType("USER")
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: harness:platform:getToken
          Arguments:
            identifier: test_token
            parentId: apikey_parent_id
            orgId: org_id
            projectId: project_id
            apikeyId: apikey_id
            apikeyType: USER
    

    Using getToken

    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 getToken(args: GetTokenArgs, opts?: InvokeOptions): Promise<GetTokenResult>
    function getTokenOutput(args: GetTokenOutputArgs, opts?: InvokeOptions): Output<GetTokenResult>
    def get_token(account_id: Optional[str] = None,
                  apikey_id: Optional[str] = None,
                  apikey_type: Optional[str] = None,
                  email: Optional[str] = None,
                  encoded_password: Optional[str] = None,
                  identifier: Optional[str] = None,
                  name: Optional[str] = None,
                  org_id: Optional[str] = None,
                  parent_id: Optional[str] = None,
                  project_id: Optional[str] = None,
                  scheduled_expire_time: Optional[int] = None,
                  username: Optional[str] = None,
                  valid: Optional[bool] = None,
                  valid_from: Optional[int] = None,
                  valid_to: Optional[int] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTokenResult
    def get_token_output(account_id: Optional[pulumi.Input[str]] = None,
                  apikey_id: Optional[pulumi.Input[str]] = None,
                  apikey_type: Optional[pulumi.Input[str]] = None,
                  email: Optional[pulumi.Input[str]] = None,
                  encoded_password: Optional[pulumi.Input[str]] = None,
                  identifier: Optional[pulumi.Input[str]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  org_id: Optional[pulumi.Input[str]] = None,
                  parent_id: Optional[pulumi.Input[str]] = None,
                  project_id: Optional[pulumi.Input[str]] = None,
                  scheduled_expire_time: Optional[pulumi.Input[int]] = None,
                  username: Optional[pulumi.Input[str]] = None,
                  valid: Optional[pulumi.Input[bool]] = None,
                  valid_from: Optional[pulumi.Input[int]] = None,
                  valid_to: Optional[pulumi.Input[int]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetTokenResult]
    func LookupToken(ctx *Context, args *LookupTokenArgs, opts ...InvokeOption) (*LookupTokenResult, error)
    func LookupTokenOutput(ctx *Context, args *LookupTokenOutputArgs, opts ...InvokeOption) LookupTokenResultOutput

    > Note: This function is named LookupToken in the Go SDK.

    public static class GetToken 
    {
        public static Task<GetTokenResult> InvokeAsync(GetTokenArgs args, InvokeOptions? opts = null)
        public static Output<GetTokenResult> Invoke(GetTokenInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: harness:platform/getToken:getToken
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account Identifier for the Entity
    ApikeyId string
    Identifier of the API Key
    ApikeyType string
    Type of the API Key
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Username string
    Name of the user who created the Token
    Valid bool
    Boolean value to indicate if Token is valid or not.
    ValidFrom int
    This is the time from which the Token is valid. The time is in milliseconds
    ValidTo int
    This is the time till which the Token is valid. The time is in milliseconds
    AccountId string
    Account Identifier for the Entity
    ApikeyId string
    Identifier of the API Key
    ApikeyType string
    Type of the API Key
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Username string
    Name of the user who created the Token
    Valid bool
    Boolean value to indicate if Token is valid or not.
    ValidFrom int
    This is the time from which the Token is valid. The time is in milliseconds
    ValidTo int
    This is the time till which the Token is valid. The time is in milliseconds
    accountId String
    Account Identifier for the Entity
    apikeyId String
    Identifier of the API Key
    apikeyType String
    Type of the API Key
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    scheduledExpireTime Integer
    Scheduled expiry time in milliseconds
    username String
    Name of the user who created the Token
    valid Boolean
    Boolean value to indicate if Token is valid or not.
    validFrom Integer
    This is the time from which the Token is valid. The time is in milliseconds
    validTo Integer
    This is the time till which the Token is valid. The time is in milliseconds
    accountId string
    Account Identifier for the Entity
    apikeyId string
    Identifier of the API Key
    apikeyType string
    Type of the API Key
    identifier string
    Unique identifier of the resource.
    parentId string
    Parent Entity Identifier of the API Key
    email string
    Email Id of the user who created the Token
    encodedPassword string
    Encoded password of the Token
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    scheduledExpireTime number
    Scheduled expiry time in milliseconds
    username string
    Name of the user who created the Token
    valid boolean
    Boolean value to indicate if Token is valid or not.
    validFrom number
    This is the time from which the Token is valid. The time is in milliseconds
    validTo number
    This is the time till which the Token is valid. The time is in milliseconds
    account_id str
    Account Identifier for the Entity
    apikey_id str
    Identifier of the API Key
    apikey_type str
    Type of the API Key
    identifier str
    Unique identifier of the resource.
    parent_id str
    Parent Entity Identifier of the API Key
    email str
    Email Id of the user who created the Token
    encoded_password str
    Encoded password of the Token
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    scheduled_expire_time int
    Scheduled expiry time in milliseconds
    username str
    Name of the user who created the Token
    valid bool
    Boolean value to indicate if Token is valid or not.
    valid_from int
    This is the time from which the Token is valid. The time is in milliseconds
    valid_to int
    This is the time till which the Token is valid. The time is in milliseconds
    accountId String
    Account Identifier for the Entity
    apikeyId String
    Identifier of the API Key
    apikeyType String
    Type of the API Key
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    scheduledExpireTime Number
    Scheduled expiry time in milliseconds
    username String
    Name of the user who created the Token
    valid Boolean
    Boolean value to indicate if Token is valid or not.
    validFrom Number
    This is the time from which the Token is valid. The time is in milliseconds
    validTo Number
    This is the time till which the Token is valid. The time is in milliseconds

    getToken Result

    The following output properties are available:

    AccountId string
    Account Identifier for the Entity
    ApikeyId string
    Identifier of the API Key
    ApikeyType string
    Type of the API Key
    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Tags List<string>
    Tags to associate with the resource.
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Username string
    Name of the user who created the Token
    Valid bool
    Boolean value to indicate if Token is valid or not.
    ValidFrom int
    This is the time from which the Token is valid. The time is in milliseconds
    ValidTo int
    This is the time till which the Token is valid. The time is in milliseconds
    AccountId string
    Account Identifier for the Entity
    ApikeyId string
    Identifier of the API Key
    ApikeyType string
    Type of the API Key
    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Tags []string
    Tags to associate with the resource.
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Username string
    Name of the user who created the Token
    Valid bool
    Boolean value to indicate if Token is valid or not.
    ValidFrom int
    This is the time from which the Token is valid. The time is in milliseconds
    ValidTo int
    This is the time till which the Token is valid. The time is in milliseconds
    accountId String
    Account Identifier for the Entity
    apikeyId String
    Identifier of the API Key
    apikeyType String
    Type of the API Key
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    tags List<String>
    Tags to associate with the resource.
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    scheduledExpireTime Integer
    Scheduled expiry time in milliseconds
    username String
    Name of the user who created the Token
    valid Boolean
    Boolean value to indicate if Token is valid or not.
    validFrom Integer
    This is the time from which the Token is valid. The time is in milliseconds
    validTo Integer
    This is the time till which the Token is valid. The time is in milliseconds
    accountId string
    Account Identifier for the Entity
    apikeyId string
    Identifier of the API Key
    apikeyType string
    Type of the API Key
    description string
    Description of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    identifier string
    Unique identifier of the resource.
    parentId string
    Parent Entity Identifier of the API Key
    tags string[]
    Tags to associate with the resource.
    email string
    Email Id of the user who created the Token
    encodedPassword string
    Encoded password of the Token
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    scheduledExpireTime number
    Scheduled expiry time in milliseconds
    username string
    Name of the user who created the Token
    valid boolean
    Boolean value to indicate if Token is valid or not.
    validFrom number
    This is the time from which the Token is valid. The time is in milliseconds
    validTo number
    This is the time till which the Token is valid. The time is in milliseconds
    account_id str
    Account Identifier for the Entity
    apikey_id str
    Identifier of the API Key
    apikey_type str
    Type of the API Key
    description str
    Description of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    identifier str
    Unique identifier of the resource.
    parent_id str
    Parent Entity Identifier of the API Key
    tags Sequence[str]
    Tags to associate with the resource.
    email str
    Email Id of the user who created the Token
    encoded_password str
    Encoded password of the Token
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    scheduled_expire_time int
    Scheduled expiry time in milliseconds
    username str
    Name of the user who created the Token
    valid bool
    Boolean value to indicate if Token is valid or not.
    valid_from int
    This is the time from which the Token is valid. The time is in milliseconds
    valid_to int
    This is the time till which the Token is valid. The time is in milliseconds
    accountId String
    Account Identifier for the Entity
    apikeyId String
    Identifier of the API Key
    apikeyType String
    Type of the API Key
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    tags List<String>
    Tags to associate with the resource.
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    scheduledExpireTime Number
    Scheduled expiry time in milliseconds
    username String
    Name of the user who created the Token
    valid Boolean
    Boolean value to indicate if Token is valid or not.
    validFrom Number
    This is the time from which the Token is valid. The time is in milliseconds
    validTo Number
    This is the time till which the Token is valid. The time is in milliseconds

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.4.1 published on Monday, Oct 14, 2024 by Pulumi