Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs
harness.platform.getToken
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Account
Id string - Account Identifier for the Entity
 - Apikey
Id string - Identifier of the API Key
 - Apikey
Type string - Type of the API Key
 - Identifier string
 - Identifier of the Token
 - Name string
 - Name of the Token
 - Parent
Id 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
 - Encoded
Password string - Encoded password of the Token
 - Org
Id string - Organization Identifier for the Entity
 - Project
Id string - Project Identifier for the Entity
 - Scheduled
Expire intTime  - Scheduled expiry time in milliseconds
 - 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.
 - 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
 
- Account
Id string - Account Identifier for the Entity
 - Apikey
Id string - Identifier of the API Key
 - Apikey
Type string - Type of the API Key
 - Identifier string
 - Identifier of the Token
 - Name string
 - Name of the Token
 - Parent
Id 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
 - Encoded
Password string - Encoded password of the Token
 - Org
Id string - Organization Identifier for the Entity
 - Project
Id string - Project Identifier for the Entity
 - Scheduled
Expire intTime  - Scheduled expiry time in milliseconds
 - 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.
 - 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
 
- account
Id String - Account Identifier for the Entity
 - apikey
Id String - Identifier of the API Key
 - apikey
Type String - Type of the API Key
 - identifier String
 - Identifier of the Token
 - name String
 - Name of the Token
 - parent
Id 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
 - encoded
Password String - Encoded password of the Token
 - org
Id String - Organization Identifier for the Entity
 - project
Id String - Project Identifier for the Entity
 - scheduled
Expire IntegerTime  - Scheduled expiry time in milliseconds
 - 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.
 - valid
From Integer - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To Integer - This is the time till which the Token is valid. The time is in milliseconds
 
- account
Id string - Account Identifier for the Entity
 - apikey
Id string - Identifier of the API Key
 - apikey
Type string - Type of the API Key
 - identifier string
 - Identifier of the Token
 - name string
 - Name of the Token
 - parent
Id 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
 - encoded
Password string - Encoded password of the Token
 - org
Id string - Organization Identifier for the Entity
 - project
Id string - Project Identifier for the Entity
 - scheduled
Expire numberTime  - Scheduled expiry time in milliseconds
 - {[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.
 - valid
From number - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To 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_ inttime  - Scheduled expiry time in milliseconds
 - 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
 
- account
Id String - Account Identifier for the Entity
 - apikey
Id String - Identifier of the API Key
 - apikey
Type String - Type of the API Key
 - identifier String
 - Identifier of the Token
 - name String
 - Name of the Token
 - parent
Id 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
 - encoded
Password String - Encoded password of the Token
 - org
Id String - Organization Identifier for the Entity
 - project
Id String - Project Identifier for the Entity
 - scheduled
Expire NumberTime  - Scheduled expiry time in milliseconds
 - 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.
 - valid
From Number - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To Number - This is the time till which the Token is valid. The time is in milliseconds
 
getToken Result
The following output properties are available:
- Account
Id string - Account Identifier for the Entity
 - Apikey
Id string - Identifier of the API Key
 - Apikey
Type 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
 - Parent
Id 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
 - Encoded
Password string - Encoded password of the Token
 - Org
Id string - Organization Identifier for the Entity
 - Project
Id string - Project Identifier for the Entity
 - Scheduled
Expire intTime  - Scheduled expiry time in milliseconds
 - 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.
 - 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
 
- Account
Id string - Account Identifier for the Entity
 - Apikey
Id string - Identifier of the API Key
 - Apikey
Type 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
 - Parent
Id 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
 - Encoded
Password string - Encoded password of the Token
 - Org
Id string - Organization Identifier for the Entity
 - Project
Id string - Project Identifier for the Entity
 - Scheduled
Expire intTime  - Scheduled expiry time in milliseconds
 - 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.
 - 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
 
- account
Id String - Account Identifier for the Entity
 - apikey
Id String - Identifier of the API Key
 - apikey
Type 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
 - parent
Id 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
 - encoded
Password String - Encoded password of the Token
 - org
Id String - Organization Identifier for the Entity
 - project
Id String - Project Identifier for the Entity
 - scheduled
Expire IntegerTime  - Scheduled expiry time in milliseconds
 - 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.
 - valid
From Integer - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To Integer - This is the time till which the Token is valid. The time is in milliseconds
 
- account
Id string - Account Identifier for the Entity
 - apikey
Id string - Identifier of the API Key
 - apikey
Type 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
 - parent
Id 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
 - encoded
Password string - Encoded password of the Token
 - org
Id string - Organization Identifier for the Entity
 - project
Id string - Project Identifier for the Entity
 - scheduled
Expire numberTime  - Scheduled expiry time in milliseconds
 - {[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.
 - valid
From number - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To 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_ inttime  - Scheduled expiry time in milliseconds
 - 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
 
- account
Id String - Account Identifier for the Entity
 - apikey
Id String - Identifier of the API Key
 - apikey
Type 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
 - parent
Id 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
 - encoded
Password String - Encoded password of the Token
 - org
Id String - Organization Identifier for the Entity
 - project
Id String - Project Identifier for the Entity
 - scheduled
Expire NumberTime  - Scheduled expiry time in milliseconds
 - 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.
 - valid
From Number - This is the time from which the Token is valid. The time is in milliseconds
 - valid
To 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 
harnessTerraform Provider.