1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. discoveryengine
  5. Schema
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.discoveryengine.Schema

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    Schema defines the structure and layout of a type of document data.

    To get more information about Schema, see:

    Example Usage

    Discoveryengine Schema Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const basicDataStore = new gcp.discoveryengine.DataStore("basic", {
        location: "global",
        dataStoreId: "data-store-id",
        displayName: "tf-test-structured-datastore",
        industryVertical: "GENERIC",
        contentConfig: "NO_CONTENT",
        solutionTypes: ["SOLUTION_TYPE_SEARCH"],
        createAdvancedSiteSearch: false,
        skipDefaultSchemaCreation: true,
    });
    const basic = new gcp.discoveryengine.Schema("basic", {
        location: basicDataStore.location,
        dataStoreId: basicDataStore.dataStoreId,
        schemaId: "schema-id",
        jsonSchema: "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    basic_data_store = gcp.discoveryengine.DataStore("basic",
        location="global",
        data_store_id="data-store-id",
        display_name="tf-test-structured-datastore",
        industry_vertical="GENERIC",
        content_config="NO_CONTENT",
        solution_types=["SOLUTION_TYPE_SEARCH"],
        create_advanced_site_search=False,
        skip_default_schema_creation=True)
    basic = gcp.discoveryengine.Schema("basic",
        location=basic_data_store.location,
        data_store_id=basic_data_store.data_store_id,
        schema_id="schema-id",
        json_schema="{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/discoveryengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		basicDataStore, err := discoveryengine.NewDataStore(ctx, "basic", &discoveryengine.DataStoreArgs{
    			Location:         pulumi.String("global"),
    			DataStoreId:      pulumi.String("data-store-id"),
    			DisplayName:      pulumi.String("tf-test-structured-datastore"),
    			IndustryVertical: pulumi.String("GENERIC"),
    			ContentConfig:    pulumi.String("NO_CONTENT"),
    			SolutionTypes: pulumi.StringArray{
    				pulumi.String("SOLUTION_TYPE_SEARCH"),
    			},
    			CreateAdvancedSiteSearch:  pulumi.Bool(false),
    			SkipDefaultSchemaCreation: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = discoveryengine.NewSchema(ctx, "basic", &discoveryengine.SchemaArgs{
    			Location:    basicDataStore.Location,
    			DataStoreId: basicDataStore.DataStoreId,
    			SchemaId:    pulumi.String("schema-id"),
    			JsonSchema:  pulumi.String("{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var basicDataStore = new Gcp.DiscoveryEngine.DataStore("basic", new()
        {
            Location = "global",
            DataStoreId = "data-store-id",
            DisplayName = "tf-test-structured-datastore",
            IndustryVertical = "GENERIC",
            ContentConfig = "NO_CONTENT",
            SolutionTypes = new[]
            {
                "SOLUTION_TYPE_SEARCH",
            },
            CreateAdvancedSiteSearch = false,
            SkipDefaultSchemaCreation = true,
        });
    
        var basic = new Gcp.DiscoveryEngine.Schema("basic", new()
        {
            Location = basicDataStore.Location,
            DataStoreId = basicDataStore.DataStoreId,
            SchemaId = "schema-id",
            JsonSchema = "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.discoveryengine.DataStore;
    import com.pulumi.gcp.discoveryengine.DataStoreArgs;
    import com.pulumi.gcp.discoveryengine.Schema;
    import com.pulumi.gcp.discoveryengine.SchemaArgs;
    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) {
            var basicDataStore = new DataStore("basicDataStore", DataStoreArgs.builder()
                .location("global")
                .dataStoreId("data-store-id")
                .displayName("tf-test-structured-datastore")
                .industryVertical("GENERIC")
                .contentConfig("NO_CONTENT")
                .solutionTypes("SOLUTION_TYPE_SEARCH")
                .createAdvancedSiteSearch(false)
                .skipDefaultSchemaCreation(true)
                .build());
    
            var basic = new Schema("basic", SchemaArgs.builder()
                .location(basicDataStore.location())
                .dataStoreId(basicDataStore.dataStoreId())
                .schemaId("schema-id")
                .jsonSchema("{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"datetime_detection\":true,\"type\":\"object\",\"geolocation_detection\":true}")
                .build());
    
        }
    }
    
    resources:
      basic:
        type: gcp:discoveryengine:Schema
        properties:
          location: ${basicDataStore.location}
          dataStoreId: ${basicDataStore.dataStoreId}
          schemaId: schema-id
          jsonSchema: '{"$schema":"https://json-schema.org/draft/2020-12/schema","datetime_detection":true,"type":"object","geolocation_detection":true}'
      basicDataStore:
        type: gcp:discoveryengine:DataStore
        name: basic
        properties:
          location: global
          dataStoreId: data-store-id
          displayName: tf-test-structured-datastore
          industryVertical: GENERIC
          contentConfig: NO_CONTENT
          solutionTypes:
            - SOLUTION_TYPE_SEARCH
          createAdvancedSiteSearch: false
          skipDefaultSchemaCreation: true
    

    Create Schema Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
    @overload
    def Schema(resource_name: str,
               args: SchemaArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Schema(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               data_store_id: Optional[str] = None,
               location: Optional[str] = None,
               schema_id: Optional[str] = None,
               json_schema: Optional[str] = None,
               project: Optional[str] = None)
    func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
    public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
    public Schema(String name, SchemaArgs args)
    public Schema(String name, SchemaArgs args, CustomResourceOptions options)
    
    type: gcp:discoveryengine:Schema
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SchemaArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var schemaResource = new Gcp.DiscoveryEngine.Schema("schemaResource", new()
    {
        DataStoreId = "string",
        Location = "string",
        SchemaId = "string",
        JsonSchema = "string",
        Project = "string",
    });
    
    example, err := discoveryengine.NewSchema(ctx, "schemaResource", &discoveryengine.SchemaArgs{
    	DataStoreId: pulumi.String("string"),
    	Location:    pulumi.String("string"),
    	SchemaId:    pulumi.String("string"),
    	JsonSchema:  pulumi.String("string"),
    	Project:     pulumi.String("string"),
    })
    
    var schemaResource = new Schema("schemaResource", SchemaArgs.builder()
        .dataStoreId("string")
        .location("string")
        .schemaId("string")
        .jsonSchema("string")
        .project("string")
        .build());
    
    schema_resource = gcp.discoveryengine.Schema("schemaResource",
        data_store_id="string",
        location="string",
        schema_id="string",
        json_schema="string",
        project="string")
    
    const schemaResource = new gcp.discoveryengine.Schema("schemaResource", {
        dataStoreId: "string",
        location: "string",
        schemaId: "string",
        jsonSchema: "string",
        project: "string",
    });
    
    type: gcp:discoveryengine:Schema
    properties:
        dataStoreId: string
        jsonSchema: string
        location: string
        project: string
        schemaId: string
    

    Schema Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Schema resource accepts the following input properties:

    DataStoreId string
    The unique id of the data store.
    Location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    SchemaId string
    The unique id of the schema.


    JsonSchema string
    The JSON representation of the schema.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    DataStoreId string
    The unique id of the data store.
    Location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    SchemaId string
    The unique id of the schema.


    JsonSchema string
    The JSON representation of the schema.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    dataStoreId String
    The unique id of the data store.
    location String
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    schemaId String
    The unique id of the schema.


    jsonSchema String
    The JSON representation of the schema.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    dataStoreId string
    The unique id of the data store.
    location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    schemaId string
    The unique id of the schema.


    jsonSchema string
    The JSON representation of the schema.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    data_store_id str
    The unique id of the data store.
    location str
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    schema_id str
    The unique id of the schema.


    json_schema str
    The JSON representation of the schema.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    dataStoreId String
    The unique id of the data store.
    location String
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    schemaId String
    The unique id of the schema.


    jsonSchema String
    The JSON representation of the schema.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Schema resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.

    Look up Existing Schema Resource

    Get an existing Schema resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SchemaState, opts?: CustomResourceOptions): Schema
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_store_id: Optional[str] = None,
            json_schema: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            schema_id: Optional[str] = None) -> Schema
    func GetSchema(ctx *Context, name string, id IDInput, state *SchemaState, opts ...ResourceOption) (*Schema, error)
    public static Schema Get(string name, Input<string> id, SchemaState? state, CustomResourceOptions? opts = null)
    public static Schema get(String name, Output<String> id, SchemaState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DataStoreId string
    The unique id of the data store.
    JsonSchema string
    The JSON representation of the schema.
    Location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    Name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SchemaId string
    The unique id of the schema.


    DataStoreId string
    The unique id of the data store.
    JsonSchema string
    The JSON representation of the schema.
    Location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    Name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SchemaId string
    The unique id of the schema.


    dataStoreId String
    The unique id of the data store.
    jsonSchema String
    The JSON representation of the schema.
    location String
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    name String
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaId String
    The unique id of the schema.


    dataStoreId string
    The unique id of the data store.
    jsonSchema string
    The JSON representation of the schema.
    location string
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    name string
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaId string
    The unique id of the schema.


    data_store_id str
    The unique id of the data store.
    json_schema str
    The JSON representation of the schema.
    location str
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    name str
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schema_id str
    The unique id of the schema.


    dataStoreId String
    The unique id of the data store.
    jsonSchema String
    The JSON representation of the schema.
    location String
    The geographic location where the data store should reside. The value can only be one of "global", "us" and "eu".
    name String
    The unique full resource name of the schema. Values are of the format projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/schemas/{schema_id}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaId String
    The unique id of the schema.


    Import

    Schema can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}

    • {{project}}/{{location}}/{{data_store_id}}/{{schema_id}}

    • {{location}}/{{data_store_id}}/{{schema_id}}

    When using the pulumi import command, Schema can be imported using one of the formats above. For example:

    $ pulumi import gcp:discoveryengine/schema:Schema default projects/{{project}}/locations/{{location}}/collections/default_collection/dataStores/{{data_store_id}}/schemas/{{schema_id}}
    
    $ pulumi import gcp:discoveryengine/schema:Schema default {{project}}/{{location}}/{{data_store_id}}/{{schema_id}}
    
    $ pulumi import gcp:discoveryengine/schema:Schema default {{location}}/{{data_store_id}}/{{schema_id}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi