File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_pubsub_schemas_create.1
.TH "GCLOUD_ALPHA_PUBSUB_SCHEMAS_CREATE" 1
.SH "NAME"
.HP
gcloud alpha pubsub schemas create \- create a Pub/Sub schema
.SH "SYNOPSIS"
.HP
\f5gcloud alpha pubsub schemas create\fR \fISCHEMA\fR \fB\-\-type\fR=\fITYPE\fR (\fB\-\-definition\fR=\fIDEFINITION\fR\ |\ \fB\-\-definition\-file\fR=\fIPATH_TO_FILE\fR) [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Create a new Pub/Sub schema.
.SH "EXAMPLES"
To create a PROTOCOL_BUFFER schema called "key\-schema" that requires exactly
one string field named "key", run:.RS 2m
$ gcloud alpha pubsub schemas create key\-schema \e
\-\-definition="syntax = 'proto3'; message Message { optional \e
string key = 1; }" \-\-type=PROTOCOL_BUFFER
.RE
To create an equivalent AVRO schema, run:.RS 2m
$ gcloud alpha pubsub schemas create key\-schema \e
\-\-definition='{ "type": "record", "namespace": "my.ns", "name":
"KeyMsg", "fields": [ { "name": "key", "type": "string" } ] }' \e
\-\-type=AVRO
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Schema resource \- Pub/Sub schema to create. This represents a Cloud resource.
(NOTE) Some attributes are not given arguments in this group but can be set in
other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5schema\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fISCHEMA\fR
ID of the schema or fully qualified identifier for the schema.
To set the \f5schema\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5schema\fR on the command line.
.RE
.sp
.RE
.RE
.sp
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-type\fR=\fITYPE\fR
Type of the schema. \fITYPE\fR must be one of: \fBavro\fR,
\fBprotocol\-buffer\fR.
.TP 2m
Schema definition.
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-definition\fR=\fIDEFINITION\fR
Inline schema definition.
.TP 2m
\fB\-\-definition\-file\fR=\fIPATH_TO_FILE\fR
File containing schema definition. Use a full or relative path to a local file
containing the value of definition_file.
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "API REFERENCE"
This command uses the \fBpubsub/v1\fR API. The full documentation for this API
can be found at: https://cloud.google.com/pubsub/docs
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud pubsub schemas create
.RE
.RS 2m
$ gcloud beta pubsub schemas create
.RE