部署 CodeArts Deploy
部署 CodeArts Deploy
- 最新动态
- 功能总览
- 产品介绍
- 快速入门
-
用户指南
- 部署服务CodeArts Deploy使用流程
- 购买并授权使用CodeArts Deploy
- 访问CodeArts Deploy服务首页
- 配置部署服务的主机集群
-
使用空白模板新建并部署应用
- 使用空白模板创建CodeArts Deploy应用
- 配置CodeArts Deploy应用的部署步骤
- 配置CodeArts Deploy应用的参数
- 配置CodeArts Deploy应用的主机环境
- 配置CodeArts Deploy应用不同角色的管理权限
- 部署CodeArts Deploy应用并查看结果
- 配置CodeArts Deploy应用的系统通知和第三方订阅通知
- 使用预置模板新建并部署应用
- 使用自定义模板新建并部署应用
- 查询审计日志(可选)
- 最佳实践
- API参考
- 场景代码示例
-
常见问题
- 主机管理
- 应用部署
-
公共问题
- 一台主机是否只能对应一个项目?
- 是否需要事先将运行环境(Tomcat、python等)安装到用户主机中,再部署应用?
- 部署应用失败,提示“AnsibleUndefinedVariable: 'xxxx' is undefined”,怎样处理?
- 应用部署成功但应用验证路径下的url无法访问,怎样处理?
- 部署应用失败,日志提示DNS解析问题如何解决?
- 草稿应用无法部署,如何解决?
- 部署应用失败,JDK已安装且已配置环境变量,但报错:please configure JDK environment variables,怎样处理?
- 日志提示权限不够,怎样处理?
- 路径不合法,怎样处理?
- 提示“环境下没有主机”,怎样处理?
- 使用sudo权限执行报错,怎样处理?
- 文件不存在或者路径不正确,怎样处理?
- 当前主机用户权限不足,怎样处理?
- 文件路径不存在,怎样处理?
- 选择【Docker应用部署-Linux】系统模板,Ubuntu22执行步骤“创建并启动容器”时失败,怎样处理?
- Windows主机部署过程中,偶现连接超时,怎样处理?
-
自定义应用步骤问题
- URL健康测试
- 选择部署来源
- 停止服务
-
拷贝文件
- 没有找到目标文件
- 文件路径不合法
- 文件不存在或者路径不正确
- 部署“拷贝文件”步骤显示成功但没达到预期结果
- 当前主机用户权限不足
- Linux环境间拷贝文件报错: copy file failed
- windows环境间拷贝文件报错:Windows does not support copying files between hosts
- 环境间拷贝文件报错:Hosts using secret key credit do not support copying files between
- 部署应用中断
- 权限不够
- 参数含反斜杠“\”(特例)
- 环境下没有主机
- 环境不存在
- windows主机部署应用失败
- 使用sudo权限执行报错
- 部署进程被第三方杀毒软件拦截
- 路径不合法
- 在Centos上安装软件提示网络故障
- 在Ubuntu上安装软件提示网络故障
- Linux机器输入Windows路径,提示安装路径输入不合法
- 删除文件
- 解压文件
- 配置文件修改
- 启动/停止Tomcat服务
- 启动/停止Go服务
- 启动/停止SpringBoot服务
- 启动/停止Nginx
- 启动/停止IIS服务
- 启动/停止Node.js
-
执行shell命令
- 部署“执行shell命令”步骤,提示新建失败
- 使用Shell命令启动服务日志显示成功实际没有启动
- 使用了服务器未识别的Shell命令
- Shell命令中引用了不存在的文件或文件夹
- Shell命令如何引用参数设置中的参数
- 部署“执行Shell命令”步骤超时
- 使用了交互性的Shell命令
- 使用su命令切换用户后再部署shell命令超时
- 部署应用中断
- 权限不够
- 参数含反斜杠“\”(特例)
- 环境下没有主机
- 环境不存在
- 使用sudo权限执行报错
- 部署进程被第三方杀毒软件拦截
- 路径不合法
- 在Centos上安装软件提示网络故障
- 在Ubuntu上安装软件提示网络故障
- Linux机器输入Windows路径,提示安装路径输入不合法
- 其它常见问题
- 执行Shell脚本
- 执行PowerShell命令
- 执行PowerShell脚本
-
执行Docker命令
- docker服务未安装
- 执行Docker命令参数错误
- 当前用户没有部署权限
- 镜像不存在
- login命令部署失败
- build命令部署失败
- tag命令部署失败
- push命令部署失败
- run命令部署失败
- start、restart、stop、rm命令部署失败
- rmi命令部署失败
- pull命令部署失败
- rm命令部署失败
- 连接超时
- 部署应用中断
- 权限不够
- 参数含反斜杠“\”(特例)
- 环境下没有主机
- 环境不存在
- windows主机部署应用失败
- 使用sudo权限执行报错
- 部署进程被第三方杀毒软件拦截
- 路径不合法
- 在Centos上安装软件提示网络故障
- 在Ubuntu上安装软件提示网络故障
- Linux机器输入Windows路径,提示安装路径输入不合法
- 执行等待
- ServiceStage相关问题
- Kubernetes部署步骤操作相关问题
-
Ansible
- 非法的入口文件路径
- 找不到入口文件
- Ansible步骤关于copy模块的报错
- 替换json参数解析错误
- Playbook脚本中service模块启动/停止服务不成功
- Ansible应用部署失败
- 执行Ansible提示Do not use the delegate_to, connection, hosts command in the Ansible PlayBook script for executing the local computer,怎样处理?
- 部署应用中断
- 权限不够
- 参数含反斜杠“\”(特例)
- 环境下没有主机
- 环境不存在
- windows主机部署应用失败
- 使用sudo权限执行报错
- 部署进程被第三方杀毒软件拦截
- 路径不合法
- 在Centos上安装软件提示网络故障
- 在Ubuntu上安装软件提示网络故障
- Linux机器输入Windows路径,提示安装路径输入不合法
- 新建IIS站点
- 安装IIS
- 安装JDK
- 安装Tomcat
- 安装Nginx
- 安装GO语言
- 安装PHP
- 安装Node.js
- 安装Python
- 安装/卸载Docker
- Istio灰度发布
- 视频帮助
- 文档下载
- 通用参考
链接复制成功!
判断当前用户在项目下是否有权限创建主机集群
功能介绍
判断当前用户在项目下是否有权限创建主机集群。
调用方法
请参见如何调用API。
URI
GET /v1/host-groups/creatable/{project_id}/permissions
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目id |
请求参数
无
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
can_created |
Boolean |
是否有创建主机集群权限,true 有权限 false 无权限 |
请求示例
https://{endpoint}/v1/host-groups/creatable/7e6caf3cd9a64d5b8ea451e38221892e/permissions
响应示例
状态码: 200
OK 请求响应成功
{ "can_created" : true }
SDK代码示例
SDK代码示例如下。
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.codeartsdeploy.v2.region.CodeArtsDeployRegion; import com.huaweicloud.sdk.codeartsdeploy.v2.*; import com.huaweicloud.sdk.codeartsdeploy.v2.model.*; public class CheckWhetherHostGroupCanBeCreatedSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); CodeArtsDeployClient client = CodeArtsDeployClient.newBuilder() .withCredential(auth) .withRegion(CodeArtsDeployRegion.valueOf("<YOUR REGION>")) .build(); CheckWhetherHostGroupCanBeCreatedRequest request = new CheckWhetherHostGroupCanBeCreatedRequest(); request.withProjectId("{project_id}"); try { CheckWhetherHostGroupCanBeCreatedResponse response = client.checkWhetherHostGroupCanBeCreated(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcodeartsdeploy.v2.region.codeartsdeploy_region import CodeArtsDeployRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcodeartsdeploy.v2 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = CodeArtsDeployClient.new_builder() \ .with_credentials(credentials) \ .with_region(CodeArtsDeployRegion.value_of("<YOUR REGION>")) \ .build() try: request = CheckWhetherHostGroupCanBeCreatedRequest() request.project_id = "{project_id}" response = client.check_whether_host_group_can_be_created(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" codeartsdeploy "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsdeploy/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsdeploy/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsdeploy/v2/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := codeartsdeploy.NewCodeArtsDeployClient( codeartsdeploy.CodeArtsDeployClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.CheckWhetherHostGroupCanBeCreatedRequest{} request.ProjectId = "{project_id}" response, err := client.CheckWhetherHostGroupCanBeCreated(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
OK 请求响应成功 |
错误码
请参见错误码。
父主题: 主机集群权限管理