
# 设置仓库是公开状态还是私有状态（废弃）
#### 功能介绍
设置仓库是公开状态还是私有状态。
#### 调试
您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=CodeHub&api=ShareTemplates)中调试该接口。
#### URI
PUT /v1/repositories/{repository_uuid}/template_status
表1路径参数 
| 参数              | 是否必选 | 参数类型   | 描述   |
|:---|:---|:---|:---|
| repository_uuid | 是    | String | 仓库id |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                          |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
表3请求Body参数 
| 参数              | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| templateType    | 是    | String           | **参数解释：** 模板类型 **取值范围：** - SHARE 个人示例模板  - PUBLIC 公开只读   |
| codeTitle       | 否    | String           | 代码模板名称                                                                                                                                                                                                                                                                                                                                |
| creatorName     | 否    | String           | 创建者名称                                                                                                                                                                                                                                                                                                                                 |
| codeDescription | 否    | String           | 代码模板描述                                                                                                                                                                                                                                                                                                                                |
| languages       | 否    | Array of strings | 模板语言                                                                                                                                                                                                                                                                                                                                  |
| plateform       | 否    | Array of strings | 模板平台                                                                                                                                                                                                                                                                                                                                  |
| entertype       | 否    | Array of strings | **参数解释：** 模板标签 **取值范围：** 不涉及。                                                                                                                                                                                                      |
   
#### 响应参数
**状态码： 200**
表4响应Body参数 
| 参数     | 参数类型                                            | 描述                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| error  | [Error] object | 响应错误                                                                                                                                                                                                                                                                                                                                         |
| result | String                                          | 响应结果                                                                                                                                                                                                                                                                                                                                         |
| status | String                                          | **参数解释：** 响应状态 **取值范围：** - success，表示接口调用成功。  - failed，表示接口调用失败。   |
   
 表5Error 
| 参数      | 参数类型   | 描述   |
|:---|:---|:---|
| code    | String | 错误码  |
| message | String | 错误信息 |
   
#### 请求示例
```
PUT https://{endpoint}/v1/repositories/{repository_uuid}/template_status
{
"templateType": "SHARE", 
"codeTitle": "exampleTitle", 
"creatorName": "exampleName", 
"codeDescription": "exampleDescription", 
"languages": ['Java'], 
"plateform": ['Console'], 
"entertype": ['AI']
}
```
#### 响应示例
**状态码： 200**
OK
```
{
  "result" : null,
  "error" : null,
  "status" : "success"
}
```
#### 状态码
| 状态码 | 描述 |
|:---|:---|
| 200 | OK |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-codeartsrepo/ErrorCode.html)。
