confluent schema-registry schema create¶
フラグ¶
--schema string REQUIRED: The path to the schema file.
-S, --subject string REQUIRED: Subject of the schema.
--type string Specify the schema type as "AVRO", "PROTOBUF", or "JSON".
--refs string The path to the references file.
--api-key string API key.
--api-secret string API key secret.
--context string CLI context name.
--environment string Environment ID.
-o, --output string Specify the output format as "human", "json", or "yaml". (default "human")
グローバルフラグ¶
-h, --help Show help for this command.
-v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).
例¶
新しいスキーマを登録します。
confluent schema-registry schema create --subject payments --schema schemafilepath
schemafilepath にあるファイルの内容は、たとえば次のようになります。
{
"type" : "record",
"namespace" : "Example",
"name" : "Employee",
"fields" : [
{ "name" : "Name" , "type" : "string" },
{ "name" : "Age" , "type" : "int" }
]
}
スキーマのタイプについて詳しくは、https://docs.confluent.io/current/schema-registry/serdes-develop/index.html を参照してください。
スキーマ参照について詳しくは、https://docs.confluent.io/current/schema-registry/serdes-develop/index.html#schema-references を参照してください。
関連情報¶
- confluent schema-registry schema - Schema Registry のスキーマを管理します。