1. Packages
  2. Confluent Provider
  3. API Docs
  4. getSchemas
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

confluentcloud.getSchemas

Explore with Pulumi AI

confluentcloud logo
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

    General Availability

    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 GetSchemasCredentials
    Filter GetSchemasFilter
    RestEndpoint string
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    SchemaRegistryCluster GetSchemasSchemaRegistryCluster
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    restEndpoint String
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schemaRegistryCluster GetSchemasSchemaRegistryCluster
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    restEndpoint string
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schemaRegistryCluster GetSchemasSchemaRegistryCluster
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    rest_endpoint str
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schema_registry_cluster GetSchemasSchemaRegistryCluster
    credentials Property Map
    filter Property Map
    restEndpoint String
    The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443).
    schemaRegistryCluster Property Map

    getSchemas Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Schemas []GetSchemasSchema
    (List of Object) List of schemas. Each schema object exports the following attributes:
    Credentials GetSchemasCredentials
    Filter GetSchemasFilter
    RestEndpoint string
    SchemaRegistryCluster GetSchemasSchemaRegistryCluster
    id String
    The provider-assigned unique ID for this managed resource.
    schemas List<GetSchemasSchema>
    (List of Object) List of schemas. Each schema object exports the following attributes:
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    restEndpoint String
    schemaRegistryCluster GetSchemasSchemaRegistryCluster
    id string
    The provider-assigned unique ID for this managed resource.
    schemas GetSchemasSchema[]
    (List of Object) List of schemas. Each schema object exports the following attributes:
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    restEndpoint string
    schemaRegistryCluster GetSchemasSchemaRegistryCluster
    id str
    The provider-assigned unique ID for this managed resource.
    schemas Sequence[GetSchemasSchema]
    (List of Object) List of schemas. Each schema object exports the following attributes:
    credentials GetSchemasCredentials
    filter GetSchemasFilter
    rest_endpoint str
    schema_registry_cluster GetSchemasSchemaRegistryCluster
    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
    restEndpoint String
    schemaRegistryCluster Property Map

    Supporting Types

    GetSchemasCredentials

    Key string
    The Schema Registry API Key.
    Secret string
    The Schema Registry API Secret.
    Key string
    The Schema Registry API Key.
    Secret string
    The Schema Registry API Secret.
    key String
    The Schema Registry API Key.
    secret String
    The Schema Registry API Secret.
    key string
    The Schema Registry API Key.
    secret string
    The Schema Registry API Secret.
    key str
    The Schema Registry API Key.
    secret str
    The Schema Registry API Secret.
    key String
    The Schema Registry API Key.
    secret String
    The Schema Registry API Secret.

    GetSchemasFilter

    Deleted bool
    The boolean flag to control whether to return soft deleted schemas. Defaults to false.
    LatestOnly bool
    The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to false.
    SubjectPrefix 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.
    LatestOnly bool
    The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to false.
    SubjectPrefix 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.
    latestOnly Boolean
    The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to false.
    subjectPrefix 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.
    latestOnly boolean
    The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to false.
    subjectPrefix 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.
    latestOnly Boolean
    The boolean flag to control whether to return latest schema versions only for each matching subject. Defaults to false.
    subjectPrefix 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, and JSON.
    Schema string
    (Required String) The schema string.
    SchemaIdentifier int
    (Required String) The ID of the Schema, for example: lsrc-abc123/test-subject/100003.
    SchemaReferences List<Pulumi.ConfluentCloud.Inputs.GetSchemasSchemaSchemaReference>
    (Optional List) The list of referenced schemas (see Schema References for more details):
    SubjectName 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, and JSON.
    Schema string
    (Required String) The schema string.
    SchemaIdentifier int
    (Required String) The ID of the Schema, for example: lsrc-abc123/test-subject/100003.
    SchemaReferences []GetSchemasSchemaSchemaReference
    (Optional List) The list of referenced schemas (see Schema References for more details):
    SubjectName 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, and JSON.
    schema String
    (Required String) The schema string.
    schemaIdentifier Integer
    (Required String) The ID of the Schema, for example: lsrc-abc123/test-subject/100003.
    schemaReferences List<GetSchemasSchemaSchemaReference>
    (Optional List) The list of referenced schemas (see Schema References for more details):
    subjectName 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, and JSON.
    schema string
    (Required String) The schema string.
    schemaIdentifier number
    (Required String) The ID of the Schema, for example: lsrc-abc123/test-subject/100003.
    schemaReferences GetSchemasSchemaSchemaReference[]
    (Optional List) The list of referenced schemas (see Schema References for more details):
    subjectName 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, and JSON.
    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[GetSchemasSchemaSchemaReference]
    (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, and JSON.
    schema String
    (Required String) The schema string.
    schemaIdentifier Number
    (Required String) The ID of the Schema, for example: lsrc-abc123/test-subject/100003.
    schemaReferences List<Property Map>
    (Optional List) The list of referenced schemas (see Schema References for more details):
    subjectName 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.
    SubjectName 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.
    SubjectName 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.
    subjectName 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.
    subjectName 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.
    subjectName 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.
    confluentcloud logo
    Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi