云服务器内容精选

  • 响应示例 状态码: 200 OK { "result" : { "name" : "master", "commit" : { "id" : "3b68902cf0eb7de3d5c8757e4a990bc3fe0af349", "short_id" : "3b68902c", "title" : "新建文件", "created_at" : "2022-03-08T03:14:39.000Z", "parent_ids" : [ "08618c900a4048aae7e4cd88913d3d521eae02eb" ], "message" : "新建文件", "author_name" : "repo", "committer_name" : "repo", "committed_date" : "2022-03-08T03:14:39.000Z" }, "protected" : true, "developers_can_push" : false, "developers_can_merge" : false, "master_can_push" : false, "master_can_merge" : false, "no_one_can_push" : true, "no_one_can_merge" : true, "in_an_opened_merge_request" : false }, "status" : "success" }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 error Error object 响应错误 result AddProtectResponse object 响应结果 status String 响应状态 表5 Error 参数 参数类型 描述 code String 错误码 message String 错误信息 表6 AddProtectResponse 参数 参数类型 描述 name String 分支名称 commit CommitRepoV2 object 提交信息 protected Boolean 是否保护 developers_can_push Boolean 是否允许开发者提交 developers_can_merge Boolean 是否允许开发者合并 master_can_push Boolean 是否允许管理员提交 master_can_merge Boolean 是否允许管理员合并 no_one_can_push Boolean 没有人允许提交 no_one_can_merge Boolean 没有人允许合并 in_an_opened_merge_request Boolean 是否在一个打开的合并请求 表7 CommitRepoV2 参数 参数类型 描述 id String 提交对应的SHA id short_id String 提交对应的短SHA id created_at String 创建时间 title String 提交标题 parent_ids Array of strings 父提交id message String 提交信息 author_name String 作者 committer_name String 提交作者 committed_date String 提交时间
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 status String 结果状态 trace_id String 请求id result String 请求返回结果,接口不同,返回不同 状态码: 401 表3 响应Body参数 参数 参数类型 描述 status String 结果状态 trace_id String 请求id error_code String 错误代码 error_msg String 错误信息
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式),下方类型可任选其一使用: application/json;charset=utf-8 application/json 缺省值:application/json X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 repository 是 String 镜像仓库名称。小写字母或数字开头,后面跟小写字母、数字、小数点、斜杠、下划线或中划线(其中下划线最多允许连续两个,小数点、斜杠、下划线、中划线不能直接相连),小写字母或数字结尾,1-128个字符。 is_public 是 Boolean 是否为公共仓库,可选值为true或false。 category 否 String 仓库类型,可设置为app_server, linux, framework_app, database, lang, other, arm。 description 否 String 镜像仓库的描述信息。
  • 响应示例 状态码: 200 OK { "result" : { "name" : "master", "commit" : { "id" : "3b68902cf0eb7de3d5c8757e4a990bc3fe0af349", "short_id" : "3b68902c", "title" : "新建文件", "created_at" : "2022-03-08T03:14:39.000Z", "parent_ids" : [ "08618c900a4048aae7e4cd88913d3d521eae02eb" ], "message" : "新建文件", "author_name" : "repo", "committer_name" : "repo", "committed_date" : "2022-03-08T03:14:39.000Z" }, "protected" : true, "developers_can_push" : false, "developers_can_merge" : false, "master_can_push" : false, "master_can_merge" : false, "no_one_can_push" : true, "no_one_can_merge" : true, "in_an_opened_merge_request" : false }, "status" : "success"}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 error Error object 响应错误 result AddProtectResponse object 响应结果 status String 响应状态 表5 Error 参数 参数类型 描述 code String 错误码 message String 错误信息 表6 AddProtectResponse 参数 参数类型 描述 name String 分支名称 commit CommitRepoV2 object 提交信息 protected Boolean 是否保护 developers_can_push Boolean 是否允许开发者提交 developers_can_merge Boolean 是否允许开发者合并 master_can_push Boolean 是否允许管理员提交 master_can_merge Boolean 是否允许管理员合并 no_one_can_push Boolean 没有人允许提交 no_one_can_merge Boolean 没有人允许合并 in_an_opened_merge_request Boolean 是否在一个打开的合并请求 表7 CommitRepoV2 参数 参数类型 描述 id String 提交对应的SHA id short_id String 提交对应的短SHA id created_at String 创建时间 title String 提交标题 parent_ids Array of strings 父提交id message String 提交信息 author_name String 作者 committer_name String 提交作者 committed_date String 提交时间
  • 处理方法 如果您的GitBash版本低于2.6.0,请将您本地的Git客户端升级到最新版本,最新版本的Git客户端默认支持TLSv1.2协议。 您也可以使用如下命令检查本地的GitBash的TLS版本: git config http.sslVersion 如果是TLSv1.0,则用下面一句命令行更新至TLSv1.2 git config --global http.sslVersion tlsv1.2