Skip to main content

CreateModel

POST 

/v1/catalog/models:create

CreateModel adds a new model. It never changes an existing one: when a model with this (provider_id, name) already exists it returns ALREADY_EXISTS and writes nothing. Use UpsertModel to edit a model.

It is not idempotent. A client that retries after a lost response and gets ALREADY_EXISTS cannot tell its own first write from someone else's; it should read the model with GetModel and compare.

The provider rules, the enabled default and the route regeneration are the same as for UpsertModel. The provider rules are checked first, so a create under a disabled provider that leaves is_enabled unset returns FAILED_PRECONDITION even when the model already exists.

Request​

Responses​

Success