Git

获取提交附件上传地址。Get commit asset upload URL.

为指定提交生成附件上传的预签名 URL。返回上传地址(upload_url)、过期时间及上传确认地址(verify_url)。 Generate a pre-signed URL for uploading an asset to the specified commit. Returns the upload URL, expiration time, and upload confirmation URL. 上传流程为:先调用此接口获取上传地址,然后将文件 PUT 到上传地址,最后调用确认接口完成上传。 Upload process: first call this endpoint to get the upload URL, then PUT the file to the upload URL, and finally call the confirmation endpoint to complete the upload. 通过 ttl 参数可设置附件保留天数。 Use the ttl parameter to set the number of days to retain the asset. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-code:rw

post/{repo}/-/git/commit-assets/{sha1}/asset-upload-url

Request

  • Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
  • URL: https://api.cnb.cool/{repo}/-/git/commit-assets/{sha1}/asset-upload-url
  • Auth: API key in header Authorization

Path parameters

repostring required

不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.

sha1string required

提交的哈希值。Commit hash.

Request body

asset_namestring

附件名称。Attachment name.

sizeinteger

附件大小,单位为字节。 Attachment size, in bytes.

ttlinteger

附件存在时间,单位为天。Attachment retention time in days.

Response

Created

Changes

No recorded changes to this operation across all 1 revision of this API.