1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. getToken
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

harness.platform.getToken

Explore with Pulumi AI

harness logo
Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs

    Data source for retrieving a Harness ApiKey Token.

    Example Usage

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

    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,
                  description: 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,
                  tags: Optional[Mapping[str, str]] = 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,
                  description: 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,
                  tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = 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
    Identifier of the Token
    Name string
    Name of the Token
    ParentId string
    Parent Entity Identifier of the API Key
    Description string
    Description of the Token
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    OrgId string
    Organization Identifier for the Entity
    ProjectId string
    Project Identifier for the Entity
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Tags Dictionary<string, string>
    Tags for the Token
    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
    Identifier of the Token
    Name string
    Name of the Token
    ParentId string
    Parent Entity Identifier of the API Key
    Description string
    Description of the Token
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    OrgId string
    Organization Identifier for the Entity
    ProjectId string
    Project Identifier for the Entity
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Tags map[string]string
    Tags for the Token
    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
    Identifier of the Token
    name String
    Name of the Token
    parentId String
    Parent Entity Identifier of the API Key
    description String
    Description of the Token
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    orgId String
    Organization Identifier for the Entity
    projectId String
    Project Identifier for the Entity
    scheduledExpireTime Integer
    Scheduled expiry time in milliseconds
    tags Map<String,String>
    Tags for the Token
    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
    Identifier of the Token
    name string
    Name of the Token
    parentId string
    Parent Entity Identifier of the API Key
    description string
    Description of the Token
    email string
    Email Id of the user who created the Token
    encodedPassword string
    Encoded password of the Token
    orgId string
    Organization Identifier for the Entity
    projectId string
    Project Identifier for the Entity
    scheduledExpireTime number
    Scheduled expiry time in milliseconds
    tags {[key: string]: string}
    Tags for the Token
    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
    Identifier of the Token
    name str
    Name of the Token
    parent_id str
    Parent Entity Identifier of the API Key
    description str
    Description of the Token
    email str
    Email Id of the user who created the Token
    encoded_password str
    Encoded password of the Token
    org_id str
    Organization Identifier for the Entity
    project_id str
    Project Identifier for the Entity
    scheduled_expire_time int
    Scheduled expiry time in milliseconds
    tags Mapping[str, str]
    Tags for the Token
    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
    Identifier of the Token
    name String
    Name of the Token
    parentId String
    Parent Entity Identifier of the API Key
    description String
    Description of the Token
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    orgId String
    Organization Identifier for the Entity
    projectId String
    Project Identifier for the Entity
    scheduledExpireTime Number
    Scheduled expiry time in milliseconds
    tags Map<String>
    Tags for the Token
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Identifier of the Token
    Name string
    Name of the Token
    ParentId string
    Parent Entity Identifier of the API Key
    Description string
    Description of the Token
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    OrgId string
    Organization Identifier for the Entity
    ProjectId string
    Project Identifier for the Entity
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Tags Dictionary<string, string>
    Tags for the Token
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Identifier of the Token
    Name string
    Name of the Token
    ParentId string
    Parent Entity Identifier of the API Key
    Description string
    Description of the Token
    Email string
    Email Id of the user who created the Token
    EncodedPassword string
    Encoded password of the Token
    OrgId string
    Organization Identifier for the Entity
    ProjectId string
    Project Identifier for the Entity
    ScheduledExpireTime int
    Scheduled expiry time in milliseconds
    Tags map[string]string
    Tags for the Token
    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
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Identifier of the Token
    name String
    Name of the Token
    parentId String
    Parent Entity Identifier of the API Key
    description String
    Description of the Token
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    orgId String
    Organization Identifier for the Entity
    projectId String
    Project Identifier for the Entity
    scheduledExpireTime Integer
    Scheduled expiry time in milliseconds
    tags Map<String,String>
    Tags for the Token
    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
    id string
    The provider-assigned unique ID for this managed resource.
    identifier string
    Identifier of the Token
    name string
    Name of the Token
    parentId string
    Parent Entity Identifier of the API Key
    description string
    Description of the Token
    email string
    Email Id of the user who created the Token
    encodedPassword string
    Encoded password of the Token
    orgId string
    Organization Identifier for the Entity
    projectId string
    Project Identifier for the Entity
    scheduledExpireTime number
    Scheduled expiry time in milliseconds
    tags {[key: string]: string}
    Tags for the Token
    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
    id str
    The provider-assigned unique ID for this managed resource.
    identifier str
    Identifier of the Token
    name str
    Name of the Token
    parent_id str
    Parent Entity Identifier of the API Key
    description str
    Description of the Token
    email str
    Email Id of the user who created the Token
    encoded_password str
    Encoded password of the Token
    org_id str
    Organization Identifier for the Entity
    project_id str
    Project Identifier for the Entity
    scheduled_expire_time int
    Scheduled expiry time in milliseconds
    tags Mapping[str, str]
    Tags for the Token
    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
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Identifier of the Token
    name String
    Name of the Token
    parentId String
    Parent Entity Identifier of the API Key
    description String
    Description of the Token
    email String
    Email Id of the user who created the Token
    encodedPassword String
    Encoded password of the Token
    orgId String
    Organization Identifier for the Entity
    projectId String
    Project Identifier for the Entity
    scheduledExpireTime Number
    Scheduled expiry time in milliseconds
    tags Map<String>
    Tags for the Token
    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 lbrlabs/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs