Clone table

POST {{baseUrl}}/api/v2/databases/:database/schemas/:schema/tables/{{name}}:clone?createMode=errorIfExists&copyGrants=false&targetDatabase=m&targetSchema=m

Create a new table by cloning from the specified resource

Request Params

KeyDatatypeRequiredDescription
createModestringQuery parameter allowing support for different modes of resource creation. Possible values include:
  • errorIfExists: Throws an error if you try to create a resource that already exists.
  • orReplace: Automatically replaces the existing resource with the current one.
  • ifNotExists: Creates a new resource when an alter is requested for a non-existent resource. | | copyGrants | boolean | | Query parameter to enable copy grants when creating the object. | | targetDatabase | string | | Database of the newly created table. Defaults to the source table's database. | | targetSchema | string | | Schema of the newly created table. Defaults to the source table's schema. |

Request Body

{"name"=>"<string>", "point_of_time"=>{"point_of_time_type"=>"magna", "reference"=>"veniam fugiat"}, "kind"=>"PERMANENT", "cluster_by"=>["<string>", "<string>"], "enable_schema_evolution"=>"<boolean>", "change_tracking"=>"<boolean>", "data_retention_time_in_days"=>"<integer>", "max_data_extension_time_in_days"=>"<integer>", "default_ddl_collation"=>"<string>", "columns"=>[{"name"=>"<string>", "datatype"=>"<string>", "nullable"=>true, "collate"=>"<string>", "default"=>"<string>", "autoincrement"=>"<boolean>", "autoincrement_start"=>"<integer>", "autoincrement_increment"=>"<integer>", "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>"}, {"name"=>"<string>", "datatype"=>"<string>", "nullable"=>true, "collate"=>"<string>", "default"=>"<string>", "autoincrement"=>"<boolean>", "autoincrement_start"=>"<integer>", "autoincrement_increment"=>"<integer>", "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>"}], "constraints"=>[{"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}, {"name"=>"<string>", "column_names"=>["<string>", "<string>"], "constraint_type"=>"<string>"}], "comment"=>"<string>", "created_on"=>"<dateTime>", "database_name"=>"<string>", "schema_name"=>"<string>", "rows"=>"<long>", "bytes"=>"<long>", "owner"=>"<string>", "dropped_on"=>"<dateTime>", "automatic_clustering"=>"<boolean>", "search_optimization"=>"<boolean>", "search_optimization_progress"=>"<long>", "search_optimization_bytes"=>"<long>", "owner_role_type"=>"<string>", "budget"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;status&quot;:&quot;\u003cstring\u003e&quot;}