Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi
confluentcloud.getSchemas
Explore with Pulumi AI
confluentcloud.getSchemas
describes a Schema data source.
Example Usage
Option #1: Manage multiple Schema Registry clusters in the same Pulumi Stack
import * as pulumi from "@pulumi/pulumi";
import * as confluentcloud from "@pulumi/confluentcloud";
const main = confluentcloud.getSchemas({
schemaRegistryCluster: {
id: essentials.id,
},
restEndpoint: essentials.restEndpoint,
filter: {
subjectPrefix: "examples.record",
latestOnly: false,
deleted: true,
},
credentials: {
key: "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
secret: "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
},
});
export const schemas = main.then(main => main.schemas);
import pulumi
import pulumi_confluentcloud as confluentcloud
main = confluentcloud.get_schemas(schema_registry_cluster={
"id": essentials["id"],
},
rest_endpoint=essentials["restEndpoint"],
filter={
"subject_prefix": "examples.record",
"latest_only": False,
"deleted": True,
},
credentials={
"key": "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
"secret": "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
})
pulumi.export("schemas", main.schemas)
package main
import (
"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := confluentcloud.GetSchemas(ctx, &confluentcloud.GetSchemasArgs{
SchemaRegistryCluster: confluentcloud.GetSchemasSchemaRegistryCluster{
Id: essentials.Id,
},
RestEndpoint: pulumi.StringRef(essentials.RestEndpoint),
Filter: confluentcloud.GetSchemasFilter{
SubjectPrefix: pulumi.StringRef("examples.record"),
LatestOnly: pulumi.BoolRef(false),
Deleted: pulumi.BoolRef(true),
},
Credentials: confluentcloud.GetSchemasCredentials{
Key: "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
Secret: "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
},
}, nil)
if err != nil {
return err
}
ctx.Export("schemas", main.Schemas)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() =>
{
var main = ConfluentCloud.GetSchemas.Invoke(new()
{
SchemaRegistryCluster = new ConfluentCloud.Inputs.GetSchemasSchemaRegistryClusterInputArgs
{
Id = essentials.Id,
},
RestEndpoint = essentials.RestEndpoint,
Filter = new ConfluentCloud.Inputs.GetSchemasFilterInputArgs
{
SubjectPrefix = "examples.record",
LatestOnly = false,
Deleted = true,
},
Credentials = new ConfluentCloud.Inputs.GetSchemasCredentialsInputArgs
{
Key = "<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>",
Secret = "<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>",
},
});
return new Dictionary<string, object?>
{
["schemas"] = main.Apply(getSchemasResult => getSchemasResult.Schemas),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetSchemasArgs;
import com.pulumi.confluentcloud.inputs.GetSchemasSchemaRegistryClusterArgs;
import com.pulumi.confluentcloud.inputs.GetSchemasFilterArgs;
import com.pulumi.confluentcloud.inputs.GetSchemasCredentialsArgs;
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 main = ConfluentcloudFunctions.getSchemas(GetSchemasArgs.builder()
.schemaRegistryCluster(GetSchemasSchemaRegistryClusterArgs.builder()
.id(essentials.id())
.build())
.restEndpoint(essentials.restEndpoint())
.filter(GetSchemasFilterArgs.builder()
.subjectPrefix("examples.record")
.latestOnly(false)
.deleted(true)
.build())
.credentials(GetSchemasCredentialsArgs.builder()
.key("<Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>")
.secret("<Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>")
.build())
.build());
ctx.export("schemas", main.applyValue(getSchemasResult -> getSchemasResult.schemas()));
}
}
variables:
main:
fn::invoke:
Function: confluentcloud:getSchemas
Arguments:
schemaRegistryCluster:
id: ${essentials.id}
restEndpoint: ${essentials.restEndpoint}
filter:
subjectPrefix: examples.record
latestOnly: false
deleted: true
credentials:
key: <Schema Registry API Key for data.confluent_schema_registry_cluster.essentials>
secret: <Schema Registry API Secret for data.confluent_schema_registry_cluster.essentials>
outputs:
schemas: ${main.schemas}
Option #2: Manage a single Schema Registry cluster in the same Pulumi Stack
import * as pulumi from "@pulumi/pulumi";
import * as confluentcloud from "@pulumi/confluentcloud";
const main = confluentcloud.getSchemas({
filter: {
subjectPrefix: "examples.record",
latestOnly: false,
deleted: true,
},
});
export const schemas = main.then(main => main.schemas);
import pulumi
import pulumi_confluentcloud as confluentcloud
main = confluentcloud.get_schemas(filter={
"subject_prefix": "examples.record",
"latest_only": False,
"deleted": True,
})
pulumi.export("schemas", main.schemas)
package main
import (
"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := confluentcloud.GetSchemas(ctx, &confluentcloud.GetSchemasArgs{
Filter: confluentcloud.GetSchemasFilter{
SubjectPrefix: pulumi.StringRef("examples.record"),
LatestOnly: pulumi.BoolRef(false),
Deleted: pulumi.BoolRef(true),
},
}, nil)
if err != nil {
return err
}
ctx.Export("schemas", main.Schemas)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;
return await Deployment.RunAsync(() =>
{
var main = ConfluentCloud.GetSchemas.Invoke(new()
{
Filter = new ConfluentCloud.Inputs.GetSchemasFilterInputArgs
{
SubjectPrefix = "examples.record",
LatestOnly = false,
Deleted = true,
},
});
return new Dictionary<string, object?>
{
["schemas"] = main.Apply(getSchemasResult => getSchemasResult.Schemas),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.ConfluentcloudFunctions;
import com.pulumi.confluentcloud.inputs.GetSchemasArgs;
import com.pulumi.confluentcloud.inputs.GetSchemasFilterArgs;
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 main = ConfluentcloudFunctions.getSchemas(GetSchemasArgs.builder()
.filter(GetSchemasFilterArgs.builder()
.subjectPrefix("examples.record")
.latestOnly(false)
.deleted(true)
.build())
.build());
ctx.export("schemas", main.applyValue(getSchemasResult -> getSchemasResult.schemas()));
}
}
variables:
main:
fn::invoke:
Function: confluentcloud:getSchemas
Arguments:
filter:
subjectPrefix: examples.record
latestOnly: false
deleted: true
outputs:
schemas: ${main.schemas}
Using getSchemas
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 getSchemas(args: GetSchemasArgs, opts?: InvokeOptions): Promise<GetSchemasResult>
function getSchemasOutput(args: GetSchemasOutputArgs, opts?: InvokeOptions): Output<GetSchemasResult>
def get_schemas(credentials: Optional[GetSchemasCredentials] = None,
filter: Optional[GetSchemasFilter] = None,
rest_endpoint: Optional[str] = None,
schema_registry_cluster: Optional[GetSchemasSchemaRegistryCluster] = None,
opts: Optional[InvokeOptions] = None) -> GetSchemasResult
def get_schemas_output(credentials: Optional[pulumi.Input[GetSchemasCredentialsArgs]] = None,
filter: Optional[pulumi.Input[GetSchemasFilterArgs]] = None,
rest_endpoint: Optional[pulumi.Input[str]] = None,
schema_registry_cluster: Optional[pulumi.Input[GetSchemasSchemaRegistryClusterArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSchemasResult]
func GetSchemas(ctx *Context, args *GetSchemasArgs, opts ...InvokeOption) (*GetSchemasResult, error)
func GetSchemasOutput(ctx *Context, args *GetSchemasOutputArgs, opts ...InvokeOption) GetSchemasResultOutput
> Note: This function is named GetSchemas
in the Go SDK.
public static class GetSchemas
{
public static Task<GetSchemasResult> InvokeAsync(GetSchemasArgs args, InvokeOptions? opts = null)
public static Output<GetSchemasResult> Invoke(GetSchemasInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSchemasResult> getSchemas(GetSchemasArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: confluentcloud:index/getSchemas:getSchemas
arguments:
# arguments dictionary
The following arguments are supported:
- Credentials
Pulumi.
Confluent Cloud. Inputs. Get Schemas Credentials - Filter
Pulumi.
Confluent Cloud. Inputs. Get Schemas Filter - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry Pulumi.Cluster Confluent Cloud. Inputs. Get Schemas Schema Registry Cluster
- Credentials
Get
Schemas Credentials - Filter
Get
Schemas Filter - Rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - Schema
Registry GetCluster Schemas Schema Registry Cluster
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry GetCluster Schemas Schema Registry Cluster
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest
Endpoint string - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry GetCluster Schemas Schema Registry Cluster
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest_
endpoint str - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema_
registry_ Getcluster Schemas Schema Registry Cluster
- credentials Property Map
- filter Property Map
- rest
Endpoint String - The REST endpoint of the Schema Registry cluster, for example,
https://psrc-00000.us-central1.gcp.confluent.cloud:443
). - schema
Registry Property MapCluster
getSchemas Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Schemas
List<Pulumi.
Confluent Cloud. Outputs. Get Schemas Schema> - (List of Object) List of schemas. Each schema object exports the following attributes:
- Credentials
Pulumi.
Confluent Cloud. Outputs. Get Schemas Credentials - Filter
Pulumi.
Confluent Cloud. Outputs. Get Schemas Filter - Rest
Endpoint string - Schema
Registry Pulumi.Cluster Confluent Cloud. Outputs. Get Schemas Schema Registry Cluster
- Id string
- The provider-assigned unique ID for this managed resource.
- Schemas
[]Get
Schemas Schema - (List of Object) List of schemas. Each schema object exports the following attributes:
- Credentials
Get
Schemas Credentials - Filter
Get
Schemas Filter - Rest
Endpoint string - Schema
Registry GetCluster Schemas Schema Registry Cluster
- id String
- The provider-assigned unique ID for this managed resource.
- schemas
List<Get
Schemas Schema> - (List of Object) List of schemas. Each schema object exports the following attributes:
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest
Endpoint String - schema
Registry GetCluster Schemas Schema Registry Cluster
- id string
- The provider-assigned unique ID for this managed resource.
- schemas
Get
Schemas Schema[] - (List of Object) List of schemas. Each schema object exports the following attributes:
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest
Endpoint string - schema
Registry GetCluster Schemas Schema Registry Cluster
- id str
- The provider-assigned unique ID for this managed resource.
- schemas
Sequence[Get
Schemas Schema] - (List of Object) List of schemas. Each schema object exports the following attributes:
- credentials
Get
Schemas Credentials - filter
Get
Schemas Filter - rest_
endpoint str - schema_
registry_ Getcluster Schemas Schema Registry Cluster
- id String
- The provider-assigned unique ID for this managed resource.
- schemas List<Property Map>
- (List of Object) List of schemas. Each schema object exports the following attributes:
- credentials Property Map
- filter Property Map
- rest
Endpoint String - schema
Registry Property MapCluster
Supporting Types
GetSchemasCredentials
GetSchemasFilter
- Deleted bool
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - Latest
Only bool - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - Subject
Prefix string - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
- Deleted bool
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - Latest
Only bool - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - Subject
Prefix string - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
- deleted Boolean
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - latest
Only Boolean - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - subject
Prefix String - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
- deleted boolean
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - latest
Only boolean - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - subject
Prefix string - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
- deleted bool
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - latest_
only bool - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - subject_
prefix str - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
- deleted Boolean
- The boolean flag to control whether to return soft deleted schemas. Defaults to
false
. - latest
Only Boolean - The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to
false
. - subject
Prefix String - The prefix of the subjects (in other words, the namespaces), representing the subjects under which the schemas are registered.
GetSchemasSchema
- Format string
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - Schema string
- (Required String) The schema string.
- Schema
Identifier int - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - Schema
References List<Pulumi.Confluent Cloud. Inputs. Get Schemas Schema Schema Reference> - (Optional List) The list of referenced schemas (see Schema References for more details):
- Subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- Version int
- (Required Integer) The version of the Schema, for example,
4
.
- Format string
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - Schema string
- (Required String) The schema string.
- Schema
Identifier int - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - Schema
References []GetSchemas Schema Schema Reference - (Optional List) The list of referenced schemas (see Schema References for more details):
- Subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- Version int
- (Required Integer) The version of the Schema, for example,
4
.
- format String
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - schema String
- (Required String) The schema string.
- schema
Identifier Integer - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - schema
References List<GetSchemas Schema Schema Reference> - (Optional List) The list of referenced schemas (see Schema References for more details):
- subject
Name String - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version Integer
- (Required Integer) The version of the Schema, for example,
4
.
- format string
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - schema string
- (Required String) The schema string.
- schema
Identifier number - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - schema
References GetSchemas Schema Schema Reference[] - (Optional List) The list of referenced schemas (see Schema References for more details):
- subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version number
- (Required Integer) The version of the Schema, for example,
4
.
- format str
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - schema str
- (Required String) The schema string.
- schema_
identifier int - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - schema_
references Sequence[GetSchemas Schema Schema Reference] - (Optional List) The list of referenced schemas (see Schema References for more details):
- subject_
name str - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version int
- (Required Integer) The version of the Schema, for example,
4
.
- format String
- (Required String) The format of the schema. Accepted values are:
AVRO
,PROTOBUF
, andJSON
. - schema String
- (Required String) The schema string.
- schema
Identifier Number - (Required String) The ID of the Schema, for example:
lsrc-abc123/test-subject/100003
. - schema
References List<Property Map> - (Optional List) The list of referenced schemas (see Schema References for more details):
- subject
Name String - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version Number
- (Required Integer) The version of the Schema, for example,
4
.
GetSchemasSchemaRegistryCluster
- Id string
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
- Id string
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
- id String
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
- id string
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
- id str
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
- id String
- The ID of the Schema Registry cluster, for example,
lsrc-abc123
.
GetSchemasSchemaSchemaReference
- Name string
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- Subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- Version int
- (Required Integer) The version of the Schema, for example,
4
.
- Name string
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- Subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- Version int
- (Required Integer) The version of the Schema, for example,
4
.
- name String
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- subject
Name String - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version Integer
- (Required Integer) The version of the Schema, for example,
4
.
- name string
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- subject
Name string - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version number
- (Required Integer) The version of the Schema, for example,
4
.
- name str
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- subject_
name str - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version int
- (Required Integer) The version of the Schema, for example,
4
.
- name String
- (Required String) The name of the subject, representing the subject under which the referenced schema is registered.
- subject
Name String - (Required String) The name for the reference. (For Avro Schema, the reference name is the fully qualified schema name, for JSON Schema it is a URL, and for Protobuf Schema, it is the name of another Protobuf file.)
- version Number
- (Required Integer) The version of the Schema, for example,
4
.
Package Details
- Repository
- Confluent Cloud pulumi/pulumi-confluentcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
confluent
Terraform Provider.