Viewing docs for Oracle Cloud Infrastructure v5.6.0
published on Thursday, Nov 5, 2026 by Pulumi
published on Thursday, Nov 5, 2026 by Pulumi
Viewing docs for Oracle Cloud Infrastructure v5.6.0
published on Thursday, Nov 5, 2026 by Pulumi
published on Thursday, Nov 5, 2026 by Pulumi
This data source provides the list of Apikeys in Oracle Cloud Infrastructure Generative Ai service.
Lists the ApiKeys of a specific compartment.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testApikeys = oci.generativeai.getApikeys({
compartmentId: compartmentId,
displayName: apikeyDisplayName,
id: apikeyId,
state: apikeyState,
});
import pulumi
import pulumi_oci as oci
test_apikeys = oci.generativeai.get_apikeys(compartment_id=compartment_id,
display_name=apikey_display_name,
id=apikey_id,
state=apikey_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v5/go/oci/generativeai"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := generativeai.GetApikeys(ctx, &generativeai.GetApikeysArgs{
CompartmentId: compartmentId,
DisplayName: pulumi.StringRef(apikeyDisplayName),
Id: pulumi.StringRef(apikeyId),
State: pulumi.StringRef(apikeyState),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testApikeys = Oci.GenerativeAi.GetApikeys.Invoke(new()
{
CompartmentId = compartmentId,
DisplayName = apikeyDisplayName,
Id = apikeyId,
State = apikeyState,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.GenerativeAi.GenerativeAiFunctions;
import com.pulumi.oci.GenerativeAi.inputs.GetApikeysArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 testApikeys = GenerativeAiFunctions.getApikeys(GetApikeysArgs.builder()
.compartmentId(compartmentId)
.displayName(apikeyDisplayName)
.id(apikeyId)
.state(apikeyState)
.build());
}
}
variables:
testApikeys:
fn::invoke:
function: oci:GenerativeAi:getApikeys
arguments:
compartmentId: ${compartmentId}
displayName: ${apikeyDisplayName}
id: ${apikeyId}
state: ${apikeyState}
terraform {
required_providers {
oci = {
source = "pulumi/oci"
}
}
}
data "oci_generative_ai_apikeys" "testApikeys" {
compartment_id = compartmentId
display_name = apikeyDisplayName
id = apikeyId
state = apikeyState
}
Using getApikeys
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 getApikeys(args: GetApikeysArgs, opts?: InvokeOptions): Promise<GetApikeysResult>
function getApikeysOutput(args: GetApikeysOutputArgs, opts?: InvokeOutputOptions): Output<GetApikeysResult>def get_apikeys(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[GetApikeysFilter]] = None,
id: Optional[str] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApikeysResult
def get_apikeys_output(compartment_id: pulumi.Input[Optional[str]] = None,
display_name: pulumi.Input[Optional[str]] = None,
filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetApikeysFilterArgs]]]] = None,
id: pulumi.Input[Optional[str]] = None,
state: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetApikeysResult]func GetApikeys(ctx *Context, args *GetApikeysArgs, opts ...InvokeOption) (*GetApikeysResult, error)
func GetApikeysOutput(ctx *Context, args *GetApikeysOutputArgs, opts ...InvokeOption) GetApikeysResultOutput> Note: This function is named GetApikeys in the Go SDK.
public static class GetApikeys
{
public static Task<GetApikeysResult> InvokeAsync(GetApikeysArgs args, InvokeOptions? opts = null)
public static Output<GetApikeysResult> Invoke(GetApikeysInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetApikeysResult> Invoke(GetApikeysInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetApikeysResult> getApikeys(GetApikeysArgs args, InvokeOptions options)
public static Output<GetApikeysResult> getApikeys(GetApikeysArgs args, InvokeOptions options)
public static Output<GetApikeysResult> getApikeys(GetApikeysArgs args, InvokeOutputOptions options)
fn::invoke:
function: oci:GenerativeAi/getApikeys:getApikeys
arguments:
# arguments dictionarydata "oci_generative_ai_get_apikeys" "name" {
# arguments
}The following arguments are supported:
- Compartment
Id string - The OCID of the compartment in which to list resources.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
List<Get
Apikeys Filter> - Id string
- The OCID of the APIKey.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Compartment
Id string - The OCID of the compartment in which to list resources.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
[]Get
Apikeys Filter - Id string
- The OCID of the APIKey.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- compartment_
id string - The OCID of the compartment in which to list resources.
- display_
name string - A filter to return only resources that match the given display name exactly.
- filters list(object)
- id string
- The OCID of the APIKey.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- compartment
Id String - The OCID of the compartment in which to list resources.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters
List<Get
Apikeys Filter> - id String
- The OCID of the APIKey.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- compartment
Id string - The OCID of the compartment in which to list resources.
- display
Name string - A filter to return only resources that match the given display name exactly.
- filters
Get
Apikeys Filter[] - id string
- The OCID of the APIKey.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- compartment_
id str - The OCID of the compartment in which to list resources.
- display_
name str - A filter to return only resources that match the given display name exactly.
- filters
Sequence[Get
Apikeys Filter] - id str
- The OCID of the APIKey.
- state str
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- compartment
Id String - The OCID of the compartment in which to list resources.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters List<Property Map>
- id String
- The OCID of the APIKey.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
getApikeys Result
The following output properties are available:
- Api
Key List<GetCollections Apikeys Api Key Collection> - The list of api_key_collection.
- Compartment
Id string - The compartment OCID to create the apiKey in.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable.
- Filters
List<Get
Apikeys Filter> - Id string
- the ApiKey id.
- State string
- The current state of the API key.
- Api
Key []GetCollections Apikeys Api Key Collection - The list of api_key_collection.
- Compartment
Id string - The compartment OCID to create the apiKey in.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable.
- Filters
[]Get
Apikeys Filter - Id string
- the ApiKey id.
- State string
- The current state of the API key.
- api_
key_ list(object)collections - The list of api_key_collection.
- compartment_
id string - The compartment OCID to create the apiKey in.
- display_
name string - A user-friendly name. Does not have to be unique, and it's changeable.
- filters list(object)
- id string
- the ApiKey id.
- state string
- The current state of the API key.
- api
Key List<GetCollections Apikeys Api Key Collection> - The list of api_key_collection.
- compartment
Id String - The compartment OCID to create the apiKey in.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable.
- filters
List<Get
Apikeys Filter> - id String
- the ApiKey id.
- state String
- The current state of the API key.
- api
Key GetCollections Apikeys Api Key Collection[] - The list of api_key_collection.
- compartment
Id string - The compartment OCID to create the apiKey in.
- display
Name string - A user-friendly name. Does not have to be unique, and it's changeable.
- filters
Get
Apikeys Filter[] - id string
- the ApiKey id.
- state string
- The current state of the API key.
- api_
key_ Sequence[Getcollections Apikeys Api Key Collection] - The list of api_key_collection.
- compartment_
id str - The compartment OCID to create the apiKey in.
- display_
name str - A user-friendly name. Does not have to be unique, and it's changeable.
- filters
Sequence[Get
Apikeys Filter] - id str
- the ApiKey id.
- state str
- The current state of the API key.
- api
Key List<Property Map>Collections - The list of api_key_collection.
- compartment
Id String - The compartment OCID to create the apiKey in.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable.
- filters List<Property Map>
- id String
- the ApiKey id.
- state String
- The current state of the API key.
Supporting Types
GetApikeysApiKeyCollection
GetApikeysApiKeyCollectionItem
- Compartment
Id string - The OCID of the compartment in which to list resources.
- Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - Description string
- An optional description of the Api key.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Dictionary<string, string>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - Id string
- The OCID of the APIKey.
- Keys
List<Get
Apikeys Api Key Collection Item Key> - The list of keys.
- Lifecycle
Details string - A message describing the current state with detail that can provide actionable information.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Dictionary<string, string>
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - Time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- Time
Updated string - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- Compartment
Id string - The OCID of the compartment in which to list resources.
- map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - Description string
- An optional description of the Api key.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- map[string]string
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - Id string
- The OCID of the APIKey.
- Keys
[]Get
Apikeys Api Key Collection Item Key - The list of keys.
- Lifecycle
Details string - A message describing the current state with detail that can provide actionable information.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- map[string]string
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - Time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- Time
Updated string - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- compartment_
id string - The OCID of the compartment in which to list resources.
- map(string)
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description string
- An optional description of the Api key.
- display_
name string - A filter to return only resources that match the given display name exactly.
- map(string)
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id string
- The OCID of the APIKey.
- keys list(object)
- The list of keys.
- lifecycle_
details string - A message describing the current state with detail that can provide actionable information.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- map(string)
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - time_
created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time_
updated string - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- compartment
Id String - The OCID of the compartment in which to list resources.
- Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description String
- An optional description of the Api key.
- display
Name String - A filter to return only resources that match the given display name exactly.
- Map<String,String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id String
- The OCID of the APIKey.
- keys
List<Get
Apikeys Api Key Collection Item Key> - The list of keys.
- lifecycle
Details String - A message describing the current state with detail that can provide actionable information.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Map<String,String>
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - time
Created String - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Updated String - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- compartment
Id string - The OCID of the compartment in which to list resources.
- {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description string
- An optional description of the Api key.
- display
Name string - A filter to return only resources that match the given display name exactly.
- {[key: string]: string}
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id string
- The OCID of the APIKey.
- keys
Get
Apikeys Api Key Collection Item Key[] - The list of keys.
- lifecycle
Details string - A message describing the current state with detail that can provide actionable information.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- {[key: string]: string}
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Updated string - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- compartment_
id str - The OCID of the compartment in which to list resources.
- Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description str
- An optional description of the Api key.
- display_
name str - A filter to return only resources that match the given display name exactly.
- Mapping[str, str]
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id str
- The OCID of the APIKey.
- keys
Sequence[Get
Apikeys Api Key Collection Item Key] - The list of keys.
- lifecycle_
details str - A message describing the current state with detail that can provide actionable information.
- state str
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Mapping[str, str]
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - time_
created str - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time_
updated str - The date and time the ApiKey was updated, in the format defined by RFC 3339.
- compartment
Id String - The OCID of the compartment in which to list resources.
- Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description String
- An optional description of the Api key.
- display
Name String - A filter to return only resources that match the given display name exactly.
- Map<String>
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id String
- The OCID of the APIKey.
- keys List<Property Map>
- The list of keys.
- lifecycle
Details String - A message describing the current state with detail that can provide actionable information.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Map<String>
- System tags for this resource. Each key is predefined and scoped to a namespace. Example:
{"orcl-cloud.free-tier-retained": "true"} - time
Created String - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Updated String - The date and time the ApiKey was updated, in the format defined by RFC 3339.
GetApikeysApiKeyCollectionItemKey
- Key string
- The key.
- Key
Mask string - The masked key.
- Key
Name string - The key name.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Time
Activated string - The date and time that the key is activated in the format of an RFC3339 datetime string.
- Time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- Time
Deactivated string - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- Time
Expiry string - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- Time
Last stringUsed - The date and time that the key is last used in the format of an RFC3339 datetime string.
- Time
Revoked string - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- Key string
- The key.
- Key
Mask string - The masked key.
- Key
Name string - The key name.
- State string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- Time
Activated string - The date and time that the key is activated in the format of an RFC3339 datetime string.
- Time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- Time
Deactivated string - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- Time
Expiry string - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- Time
Last stringUsed - The date and time that the key is last used in the format of an RFC3339 datetime string.
- Time
Revoked string - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- key string
- The key.
- key_
mask string - The masked key.
- key_
name string - The key name.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- time_
activated string - The date and time that the key is activated in the format of an RFC3339 datetime string.
- time_
created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time_
deactivated string - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- time_
expiry string - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- time_
last_ stringused - The date and time that the key is last used in the format of an RFC3339 datetime string.
- time_
revoked string - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- key String
- The key.
- key
Mask String - The masked key.
- key
Name String - The key name.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- time
Activated String - The date and time that the key is activated in the format of an RFC3339 datetime string.
- time
Created String - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Deactivated String - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- time
Expiry String - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- time
Last StringUsed - The date and time that the key is last used in the format of an RFC3339 datetime string.
- time
Revoked String - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- key string
- The key.
- key
Mask string - The masked key.
- key
Name string - The key name.
- state string
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- time
Activated string - The date and time that the key is activated in the format of an RFC3339 datetime string.
- time
Created string - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Deactivated string - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- time
Expiry string - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- time
Last stringUsed - The date and time that the key is last used in the format of an RFC3339 datetime string.
- time
Revoked string - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- key str
- The key.
- key_
mask str - The masked key.
- key_
name str - The key name.
- state str
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- time_
activated str - The date and time that the key is activated in the format of an RFC3339 datetime string.
- time_
created str - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time_
deactivated str - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- time_
expiry str - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- time_
last_ strused - The date and time that the key is last used in the format of an RFC3339 datetime string.
- time_
revoked str - The date and time that the key is revoked in the format of an RFC3339 datetime string.
- key String
- The key.
- key
Mask String - The masked key.
- key
Name String - The key name.
- state String
- A filter to return only resources that their lifecycle state matches the given lifecycle state.
- time
Activated String - The date and time that the key is activated in the format of an RFC3339 datetime string.
- time
Created String - The date and time that the ApiKey was created in the format of an RFC3339 datetime string.
- time
Deactivated String - The date and time that the key is deactivated in the format of an RFC3339 datetime string.
- time
Expiry String - The date and time when the key would be expired, if not provided it would be 90 days, in the format defined by RFC 3339.
- time
Last StringUsed - The date and time that the key is last used in the format of an RFC3339 datetime string.
- time
Revoked String - The date and time that the key is revoked in the format of an RFC3339 datetime string.
GetApikeysFilter
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ociTerraform Provider.
Viewing docs for Oracle Cloud Infrastructure v5.6.0
published on Thursday, Nov 5, 2026 by Pulumi
published on Thursday, Nov 5, 2026 by Pulumi