diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..eefafba3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +# 4 space indentation +[*.{java,xml}] +indent_style = space +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..2c33a252 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Auto detect text files and perform LF normalization +* text=auto + +*.java text eol=lf diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.md b/.github/ISSUE_TEMPLATE/Bug_Report.md new file mode 100644 index 00000000..5b6e010a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_Report.md @@ -0,0 +1,14 @@ +--- +name: Bug Report +about: If something isn't working as expected +--- + +### Version of UCloud SDK? + +### Version of Java (`java -version`)? + +### What issue did you see? + +### Steps to reproduce + +If you have have an runnable example, please include it. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..09cfb371 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ + + +FEATURES: + +ENHANCEMENTS: + +BUG FIXES: diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..d1d0b70e --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,26 @@ +name: Codecov + +on: + push: + branches: + - master + - release/* + pull_request: + types: [opened, synchronize, reopened] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Run tests + run: mvn --batch-mode --update-snapshots test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 00000000..b47da867 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,37 @@ +name: Sonar +on: + push: + branches: + - master + - release/* + pull_request: + types: [opened, synchronize, reopened] +jobs: + lint: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dgpg.skip -Dsonar.projectKey=ucloud_ucloud-sdk-java diff --git a/.gitignore b/.gitignore index 7a0640b5..d1bbd393 100755 --- a/.gitignore +++ b/.gitignore @@ -14,13 +14,12 @@ *.rar *.jar -.*/ .DS_Store +.idea/ *.iml */target target clean_private.sh -.gitattributes template/ -.gitlab-ci.yml sonar_analyze.sh +cache/ diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..fe25a258 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +JAVA_FILES=$$(find ./ -name "*.java") + +.PHONY: help +help: + @echo "build 制品构建脚" + @echo "test-cov 单元测试覆盖率基线" + @echo "fmt 格式化" + +.PHONY: build +build: + mvn clean package -DskipTests=true + +.PHONY: fmt +fmt: + google-java-format --aosp -r ${JAVA_FILES} + +.PHONY: lint +lint: + echo "skipped" + +.PHONY: test-cov +test-cov: + mvn test + +.PHONY: dev +dev: + mkdir -p cache + curl -sLo ./cache/google-java-format-1.7-all-deps.jar https://github.com/google/google-java-format/releases/download/google-java-format-1.7/google-java-format-1.7-all-deps.jar + +.PHONY: install +install: + mvn clean install -DskipTests=true diff --git a/README.md b/README.md old mode 100755 new mode 100644 index b4e4d768..7fa47b3a --- a/README.md +++ b/README.md @@ -1,219 +1,20 @@ -## ucloud-sdk-java -ucloud开发者工具套件(SDK)。
-面向UCloud的多个产品服务,目前包括: -- uhost -- udisk -- unet -- ulb -- vpc -- ufs -- usql -- pathx -- udb -- udpn -- umem -- censor -- ocr -- usms -- ubill -- ucdn +# UCloud SDK Java +[![Build Status](https://github.com/ucloud/ucloud-sdk-java/workflows/build/badge.svg)](https://github.com/ucloud/ucloud-sdk-java/actions) +[![CodeCov](https://codecov.io/gh/ucloud/ucloud-sdk-java/branch/master/graph/badge.svg)](https://codecov.io/gh/ucloud/ucloud-sdk-java) +[![Maven](https://img.shields.io/maven-central/v/cn.ucloud/ucloud-sdk-java.svg?label=Maven)](https://search.maven.org/search?q=g:%22software.amazon.awssdk%22%20AND%20a:%22s3%22) +[![Apache 2 License](https://img.shields.io/packagist/l/aws/aws-sdk-php.svg?style=flat)](http://aws.amazon.com/apache-2-0/) -后续将支持更多的UCloud的产品服务。 +## Chinese Guide -### 使用准备 -- 需要一个UCloud的账号以及一对PrivateKey、PublicKey[点此获取](https://console.ucloud.cn/uapi/apikey) - +* [快速开始](docs/quickstart.md) +* [通用配置](docs/configure.md) +* [错误处理](docs/error.md) +* [请求中间件](docs/middleware.md) +* [泛化调用](docs/generic.md) -### sdk获取 -方式一、maven仓库 +旧版请移步 [backup](https://github.com/ucloud/ucloud-sdk-java/tree/backup) 分支。 - 以使用udisk为例: - - cn.ucloud - ucloud-sdk-java-udisk - 0.8.4.4-release - +## Examples -方式二、官网下载(暂时无效) - -### 快速开始 -以使用“获取udisk信息”为例: - -第一步、创建UdiskClient并实例化,默认实例化为DefaultUdiskClient - - 在ucloud-sdk-java中,*Client都是sdk的客户端接口,通过*Client发起目标操作。并且,*Client都有一个已经 - 实现的Default*Client。 - - 在实例化Default*Client时,设置*Config参数,*Config接受一个Account对象的实例化参数。在*Config可能会 - 需要一些其他的必要参数,这个需要根据具体使用的Client确定。 - - -第二步、创建DescribeUDiskParam并实例化,作为请求的参数对象 - - 在ucloud-sdk-java中,*Param对象都是请求的参数类。 - - 每个参数类中属性注释“require”代表参数为必要参数,“optional”代表参数为可选参数。 - - *Param实例化时所需要的构造参数均为必要参数,当然,一些“Array”类型或者“对象”类型的参数并没有出现构造参数中, - 对于这样的必要参数,你需要通过set方法设置,如果缺少了这些必要参数,sdk将抛出“ValidationException”,并且在 - 异常信息中会给出必要参数的属性名称。 - -第三步、发起请求并处理结果(支持三种方式) - ----- - 方式1:同步处理 - try{ - result = client.method(param); - } catch (Exception e){ - // 这里可能会抛出一些异常 - // 比如网络异常等 - } - 这个方式与常见调用方式相同,阻塞调用,直到当前请求结果返回。 ----- - 方式2:同步回调处理 - client.method(param, new UcloudHandler<*Result>() { - @Override - public Object success(*Result result) { - // result中的retCode为0时 - return null; - } - - @Override - public Object failed(*Result result) { - // result中的retCode不为0时 - return null; - } - - @Override - public Object error(Exception e) { - // 当发生异常时候,需要在这个方法中进行处理 - return null; - } - },false); - 这个方式也是阻塞的,直到当前请求结果返回。 ----- - 方式3:异步回调处理 - 这个方式是非阻塞的,调用方式与方式2类似,但是要缺省method()最后的flag参数,或者为true。 - -代码示例: -```java -import cn.ucloud.common.pojo.Account; -import cn.ucloud.udisk.client.DefaultUdiskClient; -import cn.ucloud.udisk.client.UdiskClient; -import cn.ucloud.udisk.model.DescribeUDiskParam; -import cn.ucloud.udisk.model.DescribeUDiskResult; -import cn.ucloud.udisk.pojo.UdiskConfig; - - -public class Main { - - public static void main(String []args) { - UdiskClient client = new DefaultUdiskClient(new UdiskConfig( - new Account("PrivateKey", - "PublicKey") - )); - DescribeUDiskParam param = new DescribeUDiskParam("region"); - param.setProjectId("projectId"); - DescribeUDiskResult describeUDisk = null; - try { - describeUDisk = client.describeUDisk(param); - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(describeUDisk); - } -} -``` - - -### 版本更新历史 -- 0.6-release - - 第一个正式版本,支持了UHost、VPC、UDisk、UFS、UNet、ULB的产品服务调用 -- 0.6.1-release - - 修复了ucloud-sdk-java-common中存在的publicKey编码问题 -- 0.6.2-release - - 支持获取基础数据的接口GetRegion和GetProjectList -- 0.6.3-release - - 修复个别接口返回结果和实际有出入的问题 -- 0.6.3.1-release - - 修复DescribeEIP接口与实际接口有出入的问题 -- 0.8.0-release - - 新增UMem、USQL、UDB、PathX、UDPN产品,对既有产品接口进行更新维护 -- 0.8.1-release - - 修复UNet.CreateFirewall规则错误的bug以及udb部分接口与实际返回有出入的问题 -- 0.8.1.1-release - - 修复UNet.UpdateFirewall规则错误的bug - -- 0.8.2-release - - 新增UAI的Censor、OCR产品,部分接口更新维护 - -- 0.8.2.1-release - - USQL维护更新 - -- 0.8.2.2-release - - UHost、UDisk维护更新 - -- 0.8.2.3-release - - UDB、UMem维护更新,UHost创建主机时绑定EIP和删除主机时解绑EIP、UDisk功能 - 维护更新,新增USMS产品 - -- 0.8.2.4-release - - UDB维护更新,common错误修复 - -- 0.8.2.5-release - - UDB、USMS 、UFS、UNet、USQL、VPC维护更新,接口入参和返回参数变动,部分接口废弃 - -- 0.8.2.6-release - - UDB、UMem、UFS维护更新,UFS部分接口增加必要字段 - -- 0.8.2.7-release - - UHost、UDisk、PathX、UNet维护更新,UCloudClient新增doAction方法 - -- 0.8.2.8-release - - PathX、ULB、VPC、UDB维护更新,USMS新增接口;接口调用改用POST方式 - -- 0.8.2.9-release - - UNet、ULB、UDPN维护更新;新增UBill模块 - -- 0.8.3.0-release - - USMS修复SendUSMSMessage接口模板参数问题 - -- 0.8.4.0-release - - 新增业务模块UCDN - -- 0.8.4.1-release - - 修改参数转json逻辑,避免转义问题 - -- 0.8.4.2-release - - 默认关闭日志 - -- 0.8.4.3-release - - 支持自定义HttpClient - -- 0.8.4.4-release - - Bug fix \ No newline at end of file +- [批量创建云主机](examples/uhost) diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..762ebe9d --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.2.51-release diff --git a/docs/configure.md b/docs/configure.md new file mode 100644 index 00000000..c85d642a --- /dev/null +++ b/docs/configure.md @@ -0,0 +1,27 @@ + + +# 通用配置 + +了解如何配置 SDK,如日志、重试、服务访问端点(公有云、专有云)等。 + +## 配置项清单 + +| 配置 | 类型 | 描述 | +| --------------- | ---- | ------------------------------------------------------------ | +| **region** | String | (必填)服务所在地域,可参考 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) | +| **projectId** | String | (选填)项目的唯一标识,用于组织资源,大多数资源都需要 ProjectId,如果是主账号或财务账号,默认值为默认 ProjectId,如果是子账号非财务账号,则该字段必须填写。 | +| **baseUrl** | String | (选填) API 服务的访问端点,默认是 https://api.ucloud.cn | +| **userAgent** | String | (选填)UserAgent 是 SDK 客户端特有的属性,用于区分使用 SDK 的版本。User-Agent 的定义请参考 [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent)。用户自定义的 UserAgent 将追加到 SDK 版本号的末尾。例如, “MyAPP/0.10.1” -> “PHP/8.0.6 PHP-SDK/0.1.0 MyAPP/0.10.1” | +| **timeout** | Integer | (选填)请求超时时间,默认 30s | +| **maxRetries** | Integer | (选填)最大重试次数. 默认重试 3 次。设置该值大于 0 将对网络和服务可用性问题进行自动重试,使用指数退避的重试间隔,并自动跳过资源创建类的接口。 | +| **logger** | org.slf4j.Logger | (选填)自定义 Logger,可参考 [SLF4J](https://www.slf4j.org/) SLF4J 的定义 | + +## 进阶配置选项 + +### 访问专有云/渠道云或其它网关 + +```java +Config config = new Config(); +config.setRegion("cn-bj2"); // 设置专有云地域 +config.setBaseUrl("foo.api.ucloud.cn"); // 设置专有云网关地址 +``` diff --git a/docs/error.md b/docs/error.md new file mode 100644 index 00000000..30e0fe76 --- /dev/null +++ b/docs/error.md @@ -0,0 +1,17 @@ + + +# 错误处理 + +了解如何处理不同类型的 SDK 异常,包括参数错误,RetCode 不为 0 的业务异常等。 + +```java +try { + response = client.invoke(request, Response.class); +} catch (ValidatorException e) { + System.out.println(e.getMessage()); +} catch (RetCodeException e) { + System.out.println(e.getRetCode()); +} catch (UCloudException e) { + e.printStackTrace(); +} +``` diff --git a/docs/generic.md b/docs/generic.md new file mode 100644 index 00000000..68395934 --- /dev/null +++ b/docs/generic.md @@ -0,0 +1,46 @@ +# 泛化调用 + +如何调用 SDK 尚未支持的 API ?可以使用泛化调用方式。 + +**NOTE** 如果没有必须使用的理由,不建议使用泛化方式调用 API,因为无法享受 OpenAPI 提供的兼容性保证。 + +## 调用方式 + +```java +package cn.ucloud.example; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Main { + private static final Logger logger = LoggerFactory.getLogger(Main.class); + + public static void main(String[] args) { + Config config = new Config(); + config.setRegion("cn-bj2"); + + config.setLogger(logger); + Credential credential = + new Credential(System.getenv("UCLOUD_PUBLIC_KEY"), System.getenv("UCLOUD_PRIVATE_KEY")); + DefaultClient client = new DefaultClient(config, credential); + + Request request = new Request(); + request.setAction("GetRegion"); + + Response response = null; + try { + response = client.invoke(request, Response.class); + } catch (UCloudException e) { + e.printStackTrace(); + } + System.out.println(response); + } +} + +``` diff --git a/docs/middleware.md b/docs/middleware.md new file mode 100644 index 00000000..050e9b06 --- /dev/null +++ b/docs/middleware.md @@ -0,0 +1,49 @@ +# 请求中间件 + +了解如何拦截 SDK 发起的请求,并统一添加额外的逻辑。 + +UCloud SDK 为请求提供了请求中间件的特性。 + +该特性允许在 请求/响应 的生命周期中添加自定义的逻辑。 + +以下是一个日志中间件的示例: + +```java +package cn.ucloud.common.middlewares; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.middleware.BaseMiddleware; +import cn.ucloud.common.middleware.Context; +import cn.ucloud.common.middleware.Middleware; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; +import com.google.gson.Gson; +import org.slf4j.Logger; + +public class LogMiddleware extends BaseMiddleware implements Middleware { + + @Override + public Request handleRequest(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.info(new Gson().toJson(context.getRequest().encode())); + return super.handleRequest(context); + } + + @Override + public Response handleResponse(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.info(String.format( + "[%s] %s", context.getResponse().getRequestId(), + new Gson().toJson(context.getResponse()) + )); + return super.handleResponse(context); + } + + @Override + public void handleException(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.error(new Gson().toJson(context.getException().getMessage())); + super.handleException(context); + } +} +``` diff --git a/docs/quickstart.md b/docs/quickstart.md new file mode 100644 index 00000000..b74be61c --- /dev/null +++ b/docs/quickstart.md @@ -0,0 +1,124 @@ +# 快速开始 + +## 安装 + +使用 `maven` 安装(推荐),配置 `pom.xml`: + +```xml + + + + ucloud-sdk-java + cn.ucloud + 1.0.0-SNAPSHOT + + + 4.0.0 + ucloud-sdk-example-uhost + 0.1.0 + + + + cn.ucloud + ucloud-sdk-java-uhost + 1.0.0-SNAPSHOT + + + +``` + +## 初次使用 + +目前,SDK 使用 PublicKey/PrivateKey 作为唯一的鉴权方式,该公私钥可以从以下途径获取: + +- [账号密钥管理](https://console.ucloud.cn/uaccount/api_manage) + +下面提供一个简单的示例(详细的示例可以在 `examples/uhost` 中获取): + +之后编辑源码: + +```java +package cn.ucloud.example; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.uhost.client.UHostClient; +import cn.ucloud.uhost.models.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; + +public class Main { + private static final Logger logger = LoggerFactory.getLogger(Main.class); + + public static void main(String[] args) { + Config config = new Config(); + config.setRegion("cn-bj2"); + + config.setLogger(logger); + Credential credential = new Credential( + System.getenv("UCLOUD_PUBLIC_KEY"), + System.getenv("UCLOUD_PRIVATE_KEY") + ); + UHostClient client = new UHostClient(config, credential); + + CreateUHostInstanceRequest createUHostInstanceRequest = new CreateUHostInstanceRequest(); + createUHostInstanceRequest.setName("sdk-java-example"); + createUHostInstanceRequest.setZone("cn-bj2-05"); + createUHostInstanceRequest.setImageId("uimage-xxx"); + createUHostInstanceRequest.setLoginMode("Password"); + createUHostInstanceRequest.setPassword( + Base64.getEncoder().encodeToString("UCloud1234!".getBytes(StandardCharsets.UTF_8))); + createUHostInstanceRequest.setCPU(1); + createUHostInstanceRequest.setMemory(1024); + + List disks = new ArrayList<>(); + CreateUHostInstanceRequest.Disks disk = new CreateUHostInstanceRequest.Disks(); + disk.setSize(40); + disk.setType("CLOUD_SSD"); + disk.setIsBoot("True"); + createUHostInstanceRequest.setDisks(disks); + + CreateUHostInstanceResponse createUHostInstanceResponse = null; + try { + createUHostInstanceResponse = client.createUHostInstance(createUHostInstanceRequest); + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + System.out.println(createUHostInstanceResponse.getUHostIds()); + } +} +``` + +将上述代码中 client 相关配置,以及主机的 image id 等,替换成自己的配置,即可创建一台云主机。 + +在该示例中,使用 SDK 完成了一个创建云主机的请求。至此,已经涵盖了 SDK 的基本核心用法,可以构建自己的脚本啦! + +SDK 中的每一个 api 调用都有详细的注释文档, +可以通过 Editor/IDE 跳转到具体的方法中查看(也可以 [查看接口文档](https://docs.ucloud.cn/api/summary/README) ), +并根据 IDE 自动补全和报错信息继续探索 SDK 的用法。 + +如果需要了解这段代码提及但未完全覆盖的使用技巧,请参考: + +- [通用配置](configure.md),了解如何配置 SDK,如日志、重试、服务访问端点(公有云、专有云)等 +- [错误处理](error.md),了解如何处理不同类型的 SDK 异常,包括参数错误,RetCode 不为 0 的业务异常等 +- [请求中间件](middleware.md),了解如何拦截 SDK 发起的请求,并统一添加额外的逻辑。 +- [泛化调用](generic.md),如何调用 SDK 尚未支持的 API(不建议使用此类 API,因为没有兼容性保证) + +## 获取更多示例 + +### 基于场景的示例 + +SDK 提供了部分基于场景的示例,并提供了对应的资源销毁逻辑,可以点击以下链接查看源码: + +- [创建云主机](../examples/uhost) diff --git a/examples/generic/pom.xml b/examples/generic/pom.xml new file mode 100644 index 00000000..f794fc41 --- /dev/null +++ b/examples/generic/pom.xml @@ -0,0 +1,25 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-example-generic + ucloud-sdk-java + 0.1.0-SNAPSHOT + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + diff --git a/examples/generic/src/main/java/cn/ucloud/example/Main.java b/examples/generic/src/main/java/cn/ucloud/example/Main.java new file mode 100644 index 00000000..7e090aa1 --- /dev/null +++ b/examples/generic/src/main/java/cn/ucloud/example/Main.java @@ -0,0 +1,43 @@ +package cn.ucloud.example; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.RetCodeException; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.exception.ValidatorException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Main { + private static final Logger logger = LoggerFactory.getLogger(Main.class); + + public static void main(String[] args) { + Config config = new Config(); + config.setRegion("cn-bj2"); + + config.setLogger(logger); + Credential credential = + new Credential( + System.getenv("UCLOUD_PUBLIC_KEY"), System.getenv("UCLOUD_PRIVATE_KEY")); + DefaultClient client = new DefaultClient(config, credential); + + Request request = new Request(); + request.setAction("GetRegion"); + + Response response = null; + try { + response = client.invoke(request, Response.class); + } catch (ValidatorException e) { + System.out.println(e.getMessage()); + } catch (RetCodeException e) { + System.out.println(e.getRetCode()); + } catch (UCloudException e) { + e.printStackTrace(); + } + System.out.println(response); + } +} diff --git a/examples/generic/src/main/resources/log4j.properties b/examples/generic/src/main/resources/log4j.properties new file mode 100644 index 00000000..fc63d9a2 --- /dev/null +++ b/examples/generic/src/main/resources/log4j.properties @@ -0,0 +1,5 @@ +log4j.rootLogger=INFO, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n diff --git a/examples/uhost/pom.xml b/examples/uhost/pom.xml new file mode 100644 index 00000000..1e1c30fa --- /dev/null +++ b/examples/uhost/pom.xml @@ -0,0 +1,25 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-example-uhost + ucloud-sdk-java + 0.1.0-SNAPSHOT + + + + cn.ucloud + ucloud-sdk-java-uhost + 1.2.51-release + + + diff --git a/examples/uhost/src/main/java/cn/ucloud/example/Main.java b/examples/uhost/src/main/java/cn/ucloud/example/Main.java new file mode 100644 index 00000000..1b935791 --- /dev/null +++ b/examples/uhost/src/main/java/cn/ucloud/example/Main.java @@ -0,0 +1,150 @@ +package cn.ucloud.example; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.RetCodeException; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.uhost.client.UHostClient; +import cn.ucloud.uhost.models.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.concurrent.TimeUnit; + +public class Main { + private static final Logger logger = LoggerFactory.getLogger(Main.class); + + public static void main(String[] args) { + Config config = new Config(); + config.setRegion("cn-bj2"); + + config.setLogger(logger); + Credential credential = + new Credential( + System.getenv("UCLOUD_PUBLIC_KEY"), System.getenv("UCLOUD_PRIVATE_KEY")); + UHostClient client = new UHostClient(config, credential); + + String zone = "cn-bj2-05"; + + DescribeImageRequest describeImageRequest = new DescribeImageRequest(); + describeImageRequest.setZone(zone); + describeImageRequest.setImageType("Base"); + describeImageRequest.setOsType("Linux"); + + DescribeImageResponse describeImageResponse = null; + try { + describeImageResponse = client.describeImage(describeImageRequest); + } catch (RetCodeException e) { + System.out.println(e.getRetCode()); + + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + + DescribeImageResponse.UHostImageSet image = describeImageResponse.getImageSet().get(0); + String imageId = image.getImageId(); + + CreateUHostInstanceRequest createUHostInstanceRequest = new CreateUHostInstanceRequest(); + createUHostInstanceRequest.setName("sdk-java-示例"); + createUHostInstanceRequest.setZone(zone); + createUHostInstanceRequest.setImageId(imageId); + createUHostInstanceRequest.setLoginMode("Password"); + createUHostInstanceRequest.setPassword( + Base64.getEncoder().encodeToString("UCloud1234!".getBytes(StandardCharsets.UTF_8))); + createUHostInstanceRequest.setCPU(1); + createUHostInstanceRequest.setMemory(1024); + + List disks = new ArrayList<>(); + CreateUHostInstanceRequest.Disks disk = new CreateUHostInstanceRequest.Disks(); + disk.setSize(image.getImageSize()); + disk.setType("CLOUD_SSD"); + disk.setIsBoot("True"); + createUHostInstanceRequest.setDisks(disks); + + CreateUHostInstanceResponse createUHostInstanceResponse = null; + try { + createUHostInstanceResponse = client.createUHostInstance(createUHostInstanceRequest); + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + List ids = createUHostInstanceResponse.getUHostIds(); + + try { + Main.waitState(client, ids, zone, "Running"); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + PoweroffUHostInstanceRequest poweroffUHostInstanceRequest = + new PoweroffUHostInstanceRequest(); + poweroffUHostInstanceRequest.setZone(zone); + poweroffUHostInstanceRequest.setUHostId(ids.get(0)); + + PoweroffUHostInstanceResponse poweroffUHostInstanceResponse = null; + try { + poweroffUHostInstanceResponse = + client.poweroffUHostInstance(poweroffUHostInstanceRequest); + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + + try { + Main.waitState(client, ids, zone, "Stopped"); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + TerminateUHostInstanceRequest terminateUHostInstanceRequest = + new TerminateUHostInstanceRequest(); + terminateUHostInstanceRequest.setZone(zone); + terminateUHostInstanceRequest.setUHostId(ids.get(0)); + + TerminateUHostInstanceResponse terminateUHostInstanceResponse = null; + try { + terminateUHostInstanceResponse = + client.terminateUHostInstance(terminateUHostInstanceRequest); + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + + System.out.println("All passed!"); + } + + private static void waitState(UHostClient client, List ids, String zone, String state) + throws InterruptedException { + while (true) { + DescribeUHostInstanceRequest describeUHostInstanceRequest = + new DescribeUHostInstanceRequest(); + describeUHostInstanceRequest.setZone(zone); + describeUHostInstanceRequest.setUHostIds(ids); + + DescribeUHostInstanceResponse describeUHostInstanceResponse = null; + try { + describeUHostInstanceResponse = + client.describeUHostInstance(describeUHostInstanceRequest); + } catch (UCloudException e) { + e.printStackTrace(); + return; + } + + DescribeUHostInstanceResponse.UHostInstanceSet instance = + describeUHostInstanceResponse.getUHostSet().get(0); + System.out.printf( + "wanting %s to %s, got %s\n", + instance.getUHostId(), state, instance.getState()); + if (instance.getState().equals(state)) { + break; + } + TimeUnit.SECONDS.sleep(3); + } + } +} diff --git a/examples/uhost/src/main/resources/log4j.properties b/examples/uhost/src/main/resources/log4j.properties new file mode 100644 index 00000000..fc63d9a2 --- /dev/null +++ b/examples/uhost/src/main/resources/log4j.properties @@ -0,0 +1,5 @@ +log4j.rootLogger=INFO, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n diff --git a/pom.xml b/pom.xml old mode 100755 new mode 100644 index f2cacb0d..255b7ffe --- a/pom.xml +++ b/pom.xml @@ -7,29 +7,52 @@ cn.ucloud ucloud-sdk-java pom - 0.8.4.4-release + 1.2.51-release - ucloud-sdk-java-uhost - ucloud-sdk-java-unet - ucloud-sdk-java-ulb - ucloud-sdk-java-udisk - ucloud-sdk-java-vpc ucloud-sdk-java-common - ucloud-sdk-java-ufs + ucloud-sdk-java-cloudwatch + ucloud-sdk-java-cube + ucloud-sdk-java-ipsecvpn + ucloud-sdk-java-label + ucloud-sdk-java-nlb + ucloud-sdk-java-pathx + ucloud-sdk-java-sts + ucloud-sdk-java-uai_modelverse + ucloud-sdk-java-uaccount + ucloud-sdk-java-ubill + ucloud-sdk-java-ucdn + ucloud-sdk-java-ucompshare ucloud-sdk-java-udb + ucloud-sdk-java-udbproxy + ucloud-sdk-java-udi + ucloud-sdk-java-udns ucloud-sdk-java-udpn - ucloud-sdk-java-pathx - ucloud-sdk-java-usql + ucloud-sdk-java-udisk + ucloud-sdk-java-uec + ucloud-sdk-java-uewaf + ucloud-sdk-java-ufs + ucloud-sdk-java-ufile + ucloud-sdk-java-uhost + ucloud-sdk-java-uk8s + ucloud-sdk-java-ulb + ucloud-sdk-java-ulog ucloud-sdk-java-umem - ucloud-sdk-java-censor - ucloud-sdk-java-ocr + ucloud-sdk-java-umon + ucloud-sdk-java-umongodb + ucloud-sdk-java-unet + ucloud-sdk-java-upfs + ucloud-sdk-java-uphost + ucloud-sdk-java-upgsql + ucloud-sdk-java-uphone + ucloud-sdk-java-uslk ucloud-sdk-java-usms - ucloud-sdk-java-ubill - ucloud-sdk-java-ucdn + ucloud-sdk-java-usnap + ucloud-sdk-java-uvms + ucloud-sdk-java-vpc ucloud-sdk-java - http://www.ucloud.cn + https://www.ucloud.cn ucloud-sdk-java @@ -47,33 +70,32 @@ - zhangjianhui - jianhui.zhang@ucloud.cn + ali.yu + ali.yu@ucloud.cn https://github.com/ucloud/ucloud-sdk-java - yinjun - joshua.yin@ucloud.cn + wenqian.tang + wenqian.tang@ucloud.cn https://github.com/ucloud/ucloud-sdk-java - sonatype-nexus-ucloud - https://oss.sonatype.org/content/repositories/snapshots/ + central + https://central.sonatype.com/repository/maven-snapshots/ - sonatype-nexus-ucloud - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + central + https://central.sonatype.com/repository/maven-releases/ - UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 4.11 4.5.6 4.5.6 @@ -84,10 +106,18 @@ 1.9 1.7.25 1.5.0 + 0.8.0 + ucloud + https://sonarcloud.io + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + junit junit @@ -119,7 +149,6 @@ - org.slf4j @@ -135,13 +164,11 @@ provided - - - - org.hibernate - hibernate-validator - ${validator.version} + org.mockito + mockito-core + 4.1.0 + test @@ -178,6 +205,18 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + true + published + ucloud-sdk-java + + org.apache.maven.plugins @@ -188,20 +227,39 @@ 1.8 - org.apache.maven.plugins maven-surefire-plugin 2.18.1 - true + false + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + + prepare-agent + + + + generate-code-coverage-report + test + + report + + + + org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + 3.3.0 UTF-8 @@ -239,15 +297,21 @@ 1.6 + sign-artifacts verify - - sign - + + sign + + + 339E925AC495D2A80D9C7E27E04CE029BE42D2B5 + + --pinentry-mode + loopback + + - - diff --git a/ucloud-sdk-java-censor/pom.xml b/ucloud-sdk-java-censor/pom.xml deleted file mode 100644 index a3c9ec0a..00000000 --- a/ucloud-sdk-java-censor/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - ucloud-sdk-java - cn.ucloud - 0.8.4.4-release - - - 4.0.0 - ucloud-sdk-java-censor - 0.8.4.4-release - - - - cn.ucloud - ucloud-sdk-java-common - 0.8.4.4-release - - - - - org.hibernate - hibernate-validator - - - - junit - junit - test - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-simple - provided - - - - org.skyscreamer - jsonassert - test - - - \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/CensorClient.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/CensorClient.java deleted file mode 100644 index 4734d0d4..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/CensorClient.java +++ /dev/null @@ -1,226 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.CreateUAICensorResourceParam; -import cn.ucloud.censor.model.CreateUAICensorResourceResult; -import cn.ucloud.censor.model.DeleteUAICensorResourceParam; -import cn.ucloud.censor.model.DeleteUAICensorResourceResult; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeParam; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeResult; -import cn.ucloud.censor.model.GetUAICensorResourceListParam; -import cn.ucloud.censor.model.GetUAICensorResourceListResult; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoResult; -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceNameParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceNameResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoResult; -import cn.ucloud.common.client.UcloudClient; -import cn.ucloud.common.handler.UcloudHandler; - -/** - * @Description : censor 客户端接口 - * @Author : codezhang - * @Date : 2019-04-17 10:47 - **/ -public interface CensorClient extends UcloudClient { - - /** - * 获取UAI安全审查资源监控信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAICensorResourceMetricInfoResult - getUAICensorResourceMetricInfo(GetUAICensorResourceMetricInfoParam param) throws Exception; - - /** - * 获取UAI安全审查资源监控信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAICensorResourceMetricInfo(GetUAICensorResourceMetricInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取UAI安全审查资源请求记录 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAICensorResourceRecordInfoResult - getUAICensorResourceRecordInfo(GetUAICensorResourceRecordInfoParam param) throws Exception; - - /** - * 获取UAI安全审查资源请求记录 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAICensorResourceRecordInfo(GetUAICensorResourceRecordInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 更改UAI安全审查资源对象存储信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAICensorResourceOssInfoResult modifyUAICensorResourceOssInfo( - ModifyUAICensorResourceOssInfoParam param) throws Exception; - - /** - * 更改UAI安全审查资源对象存储信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAICensorResourceOssInfo(ModifyUAICensorResourceOssInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 删除UAI安全审查资源 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteUAICensorResourceResult deleteUAICensorResource( - DeleteUAICensorResourceParam param) throws Exception; - - /** - * 删除UAI安全审查资源 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteUAICensorResource(DeleteUAICensorResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 修改UAI安全审查资源名称 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAICensorResourceNameResult modifyUAICensorResourceName( - ModifyUAICensorResourceNameParam param) throws Exception; - - /** - * 修改UAI安全审查资源名称 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAICensorResourceName(ModifyUAICensorResourceNameParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 修改UAI安全审查资源备注 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAICensorResourceMemoResult modifyUAICensorResourceMemo( - ModifyUAICensorResourceMemoParam param) throws Exception; - - /** - * 修改UAI安全审查资源备注 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAICensorResourceMemo(ModifyUAICensorResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取UAI安全审查资源列表 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAICensorResourceListResult getUAICensorResourceList( - GetUAICensorResourceListParam param) throws Exception; - - /** - * 获取UAI安全审查资源列表 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAICensorResourceList(GetUAICensorResourceListParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 创建UAI安全审查资源 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateUAICensorResourceResult createUAICensorResource( - CreateUAICensorResourceParam param) throws Exception; - - /** - * 创建UAI安全审查资源 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createUAICensorResource(CreateUAICensorResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取可用的UAI安全审查资源类型 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAICensorAvailResourceTypeResult getUAICensorAvailResourceType( - GetUAICensorAvailResourceTypeParam param) throws Exception; - - /** - * 获取可用的UAI安全审查资源类型 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAICensorAvailResourceType(GetUAICensorAvailResourceTypeParam param, - UcloudHandler handler, - Boolean... asyncFlag); - -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/DefaultCensorClient.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/DefaultCensorClient.java deleted file mode 100644 index 5ebc8883..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/client/DefaultCensorClient.java +++ /dev/null @@ -1,201 +0,0 @@ -package cn.ucloud.censor.client; - - -import cn.ucloud.censor.model.CreateUAICensorResourceParam; -import cn.ucloud.censor.model.CreateUAICensorResourceResult; -import cn.ucloud.censor.model.DeleteUAICensorResourceParam; -import cn.ucloud.censor.model.DeleteUAICensorResourceResult; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeParam; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeResult; -import cn.ucloud.censor.model.GetUAICensorResourceListParam; -import cn.ucloud.censor.model.GetUAICensorResourceListResult; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoResult; -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceNameParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceNameResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.client.DefaultUcloudClient; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.http.UcloudHttp; -import cn.ucloud.common.http.UcloudHttpImpl; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 10:49 - **/ -public class DefaultCensorClient extends DefaultUcloudClient implements CensorClient { - - - public DefaultCensorClient(CensorConfig config) { - super(config); - } - - @Override - public GetUAICensorResourceMetricInfoResult - getUAICensorResourceMetricInfo(GetUAICensorResourceMetricInfoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceMetricInfoResult.class); - return (GetUAICensorResourceMetricInfoResult) http.doPost(param, config, null); - } - - @Override - public void getUAICensorResourceMetricInfo(GetUAICensorResourceMetricInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceMetricInfoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAICensorResourceRecordInfoResult - getUAICensorResourceRecordInfo(GetUAICensorResourceRecordInfoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceRecordInfoResult.class); - return (GetUAICensorResourceRecordInfoResult) http.doPost(param, config, null); - } - - @Override - public void getUAICensorResourceRecordInfo(GetUAICensorResourceRecordInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceRecordInfoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAICensorResourceOssInfoResult - modifyUAICensorResourceOssInfo(ModifyUAICensorResourceOssInfoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceOssInfoResult.class); - return (ModifyUAICensorResourceOssInfoResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAICensorResourceOssInfo(ModifyUAICensorResourceOssInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceOssInfoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DeleteUAICensorResourceResult - deleteUAICensorResource(DeleteUAICensorResourceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteUAICensorResourceResult.class); - return (DeleteUAICensorResourceResult) http.doPost(param, config, null); - } - - @Override - public void deleteUAICensorResource(DeleteUAICensorResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteUAICensorResourceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAICensorResourceNameResult - modifyUAICensorResourceName(ModifyUAICensorResourceNameParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceNameResult.class); - return (ModifyUAICensorResourceNameResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAICensorResourceName(ModifyUAICensorResourceNameParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceNameResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAICensorResourceMemoResult - modifyUAICensorResourceMemo(ModifyUAICensorResourceMemoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceMemoResult.class); - return (ModifyUAICensorResourceMemoResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAICensorResourceMemo(ModifyUAICensorResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAICensorResourceMemoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAICensorResourceListResult - getUAICensorResourceList(GetUAICensorResourceListParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceListResult.class); - return (GetUAICensorResourceListResult) http.doPost(param, config, null); - } - - @Override - public void getUAICensorResourceList(GetUAICensorResourceListParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorResourceListResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateUAICensorResourceResult - createUAICensorResource(CreateUAICensorResourceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateUAICensorResourceResult.class); - return (CreateUAICensorResourceResult) http.doPost(param, config, null); - } - - @Override - public void createUAICensorResource(CreateUAICensorResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorAvailResourceTypeResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAICensorAvailResourceTypeResult - getUAICensorAvailResourceType(GetUAICensorAvailResourceTypeParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorAvailResourceTypeResult.class); - return (GetUAICensorAvailResourceTypeResult) http.doPost(param, config, null); - } - - @Override - public void getUAICensorAvailResourceType(GetUAICensorAvailResourceTypeParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAICensorAvailResourceTypeResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceParam.java deleted file mode 100644 index 29011f24..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceParam.java +++ /dev/null @@ -1,117 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.exception.ValidatorException; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - -/** - * @Description : 创建UAI安全审查资源 - * @Author : codezhang - * @Date : 2019-04-17 13:43 - **/ -public class CreateUAICensorResourceParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @NotEmpty(message = "zone can not be empty") - @UcloudParam("Zone") - private String zone; - - /** - * 待创建资源类型。可选资源类型可通过GetUAICensorAvailResourceType获取。 - */ - private List resourceTypeIds; - - /** - * 待创建资源名称。默认资源名称AutoCensor-timestamp。 - */ - @UcloudParam("ResourceName") - private String resourceName; - - /** - * 待创建资源备注。默认为空。 - */ - @UcloudParam("ResourceMemo") - private String resourceMemo; - - - public CreateUAICensorResourceParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - List resourceTypeIds) { - super("CreateUAICensorResource"); - this.region = region; - this.zone = zone; - this.resourceTypeIds = resourceTypeIds; - } - - @UcloudParam("ResourceType") - public List checkResourceTypeIds() throws ValidatorException { - if (resourceTypeIds == null || resourceTypeIds.isEmpty()) { - throw new ValidatorException("resourceTypeIds is empty"); - } - List params = new ArrayList<>(); - int count = resourceTypeIds.size(); - for (int i = 0; i < count; i++) { - Integer id = resourceTypeIds.get(i); - if (id == null) { - throw new ValidatorException(String.format("resourceTypeIds.[%d] is null", i)); - } - Param param = new Param(String.format("ResourceType.%d", i), id); - params.add(param); - } - return params; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public List getResourceTypeIds() { - return resourceTypeIds; - } - - public void setResourceTypeIds(List resourceTypeIds) { - this.resourceTypeIds = resourceTypeIds; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceResult.java deleted file mode 100644 index ae132aae..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/CreateUAICensorResourceResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -/** - * @Description : 创建UAI安全审查资源 - * @Author : codezhang - * @Date : 2019-04-17 14:02 - **/ -public class CreateUAICensorResourceResult extends BaseResponseResult { - /** - * 创建的资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceParam.java deleted file mode 100644 index 0a0f4f0e..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceParam.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :删除UAI安全审查资源 - * @Author : codezhang - * @Date : 2019-04-17 14:40 - **/ -public class DeleteUAICensorResourceParam extends BaseRequestParam { - - /** - * 地域 - */ - @UcloudParam("Region") - @NotEmpty(message = "region can not be empty") - private String region; - - /** - * 可用区 - */ - @UcloudParam("Zone") - @NotEmpty(message = "zone can not be empty") - private String zone; - - /** - * 资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - public DeleteUAICensorResourceParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - @NotEmpty(message = "resourceId can not be empty") String resourceId) { - super("DeleteUAICensorResource"); - this.region = region; - this.zone = zone; - this.resourceId = resourceId; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceResult.java deleted file mode 100644 index eb5139f5..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/DeleteUAICensorResourceResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :删除UAI安全审查资源 - * @Author : codezhang - * @Date : 2019-04-17 14:41 - **/ -public class DeleteUAICensorResourceResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeParam.java deleted file mode 100644 index 21a06234..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeParam.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 获取可用的UAI安全审查资源类型 - * @Author : codezhang - * @Date : 2019-04-17 10:41 - **/ -public class GetUAICensorAvailResourceTypeParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @NotEmpty(message = "zone can not be empty") - @UcloudParam("Zone") - private String zone; - - public GetUAICensorAvailResourceTypeParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone) { - super("GetUAICensorAvailResourceType"); - this.region = region; - this.zone = zone; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeResult.java deleted file mode 100644 index 7e716b7f..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorAvailResourceTypeResult.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : 获取可用的UAI安全审查资源类型 - * @Author : codezhang - * @Date : 2019-04-17 10:43 - **/ -public class GetUAICensorAvailResourceTypeResult extends BaseResponseResult { - - /** - * 支持的资源类型总数 - */ - @SerializedName("TotalCount") - private Integer totalCount; - - /** - * 支持资源类型的具体信息 - */ - @SerializedName("DataSet") - private List typeInfos; - - - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(Integer totalCount) { - this.totalCount = totalCount; - } - - public List getTypeInfos() { - return typeInfos; - } - - public void setTypeInfos(List typeInfos) { - this.typeInfos = typeInfos; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListParam.java deleted file mode 100644 index 3b983df4..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListParam.java +++ /dev/null @@ -1,80 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 获取UAI安全审查资源列表 - * @Author : codezhang - * @Date : 2019-04-17 14:09 - **/ -public class GetUAICensorResourceListParam extends BaseRequestParam { - - /** - * 地域 - */ - @UcloudParam("Region") - @NotEmpty(message = "region can not be empty") - private String region; - - /** - * 可用区 - */ - @UcloudParam("Zone") - @NotEmpty(message = "zone can not be empty") - private String zone; - - /** - * 查询限制条数,默认无限制 - */ - @UcloudParam("Limit") - private Integer limit; - - /** - * 查询起始偏移量,默认为0 - */ - @UcloudParam("Offset") - private Integer offset; - - - public GetUAICensorResourceListParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone) { - super("GetUAICensorResourceList"); - this.region = region; - this.zone = zone; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListResult.java deleted file mode 100644 index 59370c1c..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceListResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:12 - **/ -public class GetUAICensorResourceListResult extends BaseResponseResult { - - /** - * 资源总数 - */ - @SerializedName("TotalCount") - private Integer totalCount; - - /** - * 资源具体信息 - */ - @SerializedName("DataSet") - private List resourceInfos; - - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(Integer totalCount) { - this.totalCount = totalCount; - } - - public List getResourceInfos() { - return resourceInfos; - } - - public void setResourceInfos(List resourceInfos) { - this.resourceInfos = resourceInfos; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoParam.java deleted file mode 100644 index aac6b412..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoParam.java +++ /dev/null @@ -1,117 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * @Description : 获取UAI安全审查资源监控信息 - * @Author : codezhang - * @Date : 2019-04-18 17:20 - **/ -public class GetUAICensorResourceMetricInfoParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 开始查询时间,时间戳形式 - */ - @NotNull(message = "beginTime can not be null") - @UcloudParam("BeginTime") - private Long beginTime; - - /** - * 结束查询时间,时间戳形式 - */ - @NotNull(message = "endTime can not be null") - @UcloudParam("EndTime") - private Long endTime; - - /** - * 资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 统计时间间隔,单位s。 - * 若统计时间超过24小时, - * 默认按照小时(3600s)统计, - * 否则默认按分钟(60s)统计。 - */ - @UcloudParam("Interval") - private Integer interval; - - public GetUAICensorResourceMetricInfoParam(@NotEmpty(message = "region can not be empty") String region, - @NotNull(message = "beginTime can not be null") Long beginTime, - @NotNull(message = "endTime can not be null") Long endTime, - @NotEmpty(message = "resourceId can not be empty") String resourceId) { - super("GetUAICensorResourceMetricInfo"); - this.region = region; - this.beginTime = beginTime; - this.endTime = endTime; - this.resourceId = resourceId; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public Long getBeginTime() { - return beginTime; - } - - public void setBeginTime(Long beginTime) { - this.beginTime = beginTime; - } - - public Long getEndTime() { - return endTime; - } - - public void setEndTime(Long endTime) { - this.endTime = endTime; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public Integer getInterval() { - return interval; - } - - public void setInterval(Integer interval) { - this.interval = interval; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoResult.java deleted file mode 100644 index 878c04d7..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceMetricInfoResult.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description :获取UAI安全审查资源监控信息 - * @Author : codezhang - * @Date : 2019-04-18 17:28 - **/ -public class GetUAICensorResourceMetricInfoResult extends BaseResponseResult { - - /** - * 资源的监控信息 - */ - @SerializedName("DataSet") - private List requestInfos; - - public List getRequestInfos() { - return requestInfos; - } - - public void setRequestInfos(List requestInfos) { - this.requestInfos = requestInfos; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoParam.java deleted file mode 100644 index b3916e8d..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoParam.java +++ /dev/null @@ -1,102 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import com.google.gson.annotations.SerializedName; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * @Description :获取UAI安全审查资源请求记录 - * @Author : codezhang - * @Date : 2019-04-18 16:42 - **/ -public class GetUAICensorResourceRecordInfoParam extends BaseRequestParam { - - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @NotEmpty(message = "zone can not be empty") - @UcloudParam("Zone") - private String zone; - - /** - * 开始查询时间,时间戳形式 - */ - @NotNull(message = "beginTime can not be null") - @UcloudParam("BeginTime") - private Long beginTime; - - /** - * 结束查询时间,时间戳形式 - */ - @NotNull(message = "endTime can not be null") - @UcloudParam("EndTime") - private Long endTime; - - /** - * 资源ID,若不提供则给出当前账号下所有资源的请求记录信息。 - */ - @UcloudParam("ResourceId") - private String resourceId; - - public GetUAICensorResourceRecordInfoParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - @NotNull(message = "beginTime can not be null") Long beginTime, - @NotNull(message = "endTime can not be null") Long endTime) { - super("GetUAICensorResourceRecordInfo"); - this.region = region; - this.zone = zone; - this.beginTime = beginTime; - this.endTime = endTime; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public Long getBeginTime() { - return beginTime; - } - - public void setBeginTime(Long beginTime) { - this.beginTime = beginTime; - } - - public Long getEndTime() { - return endTime; - } - - public void setEndTime(Long endTime) { - this.endTime = endTime; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoResult.java deleted file mode 100644 index 4cda99f7..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/GetUAICensorResourceRecordInfoResult.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : 获取UAI安全审查资源请求记录 - * @Author : codezhang - * @Date : 2019-04-18 16:49 - **/ -public class GetUAICensorResourceRecordInfoResult extends BaseResponseResult { - - /** - * 记录总数 - */ - @SerializedName("TotalRecordCount") - private Integer totalRecordCount; - - /** - * 记录的审查请求总数 - */ - @SerializedName("TotalCensorCount") - private Integer totalCensorCount; - - /** - * 记录的具体信息 - */ - @SerializedName("DataSet") - private List recordInfos; - - public Integer getTotalRecordCount() { - return totalRecordCount; - } - - public void setTotalRecordCount(Integer totalRecordCount) { - this.totalRecordCount = totalRecordCount; - } - - public Integer getTotalCensorCount() { - return totalCensorCount; - } - - public void setTotalCensorCount(Integer totalCensorCount) { - this.totalCensorCount = totalCensorCount; - } - - public List getRecordInfos() { - return recordInfos; - } - - public void setRecordInfos(List recordInfos) { - this.recordInfos = recordInfos; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoParam.java deleted file mode 100644 index 91a76c76..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 修改UAI安全审查资源备注 - * @Author : codezhang - * @Date : 2019-04-17 14:20 - **/ -public class ModifyUAICensorResourceMemoParam extends BaseRequestParam { - - /** - * 地域 - */ - @UcloudParam("Region") - @NotEmpty(message = "region can not be empty") - private String region; - - /** - * 可用区 - */ - @UcloudParam("Zone") - @NotEmpty(message = "zone can not be empty") - private String zone; - - /** - * 资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的资源备注 - */ - @NotEmpty(message = "resourceMemo can not be empty") - @UcloudParam("ResourceMemo") - private String resourceMemo; - - - public ModifyUAICensorResourceMemoParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "resourceMemo can not be empty") String resourceMemo) { - super("ModifyUAICensorResourceMemo"); - this.region = region; - this.zone = zone; - this.resourceId = resourceId; - this.resourceMemo = resourceMemo; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoResult.java deleted file mode 100644 index 66815e91..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceMemoResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description : 修改UAI安全审查资源备注 - * @Author : codezhang - * @Date : 2019-04-17 14:25 - **/ -public class ModifyUAICensorResourceMemoResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameParam.java deleted file mode 100644 index 2948a242..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameParam.java +++ /dev/null @@ -1,85 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 修改UAI安全审查资源名称 - * @Author : codezhang - * @Date : 2019-04-17 14:33 - **/ -public class ModifyUAICensorResourceNameParam extends BaseRequestParam { - - /** - * 地域 - */ - @UcloudParam("Region") - @NotEmpty(message = "region can not be empty") - private String region; - - /** - * 可用区 - */ - @UcloudParam("Zone") - @NotEmpty(message = "zone can not be empty") - private String zone; - - /** - * 资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的资源名称 - */ - @NotEmpty(message = "resourceName can not be empty") - @UcloudParam("ResourceName") - private String resourceName; - - public ModifyUAICensorResourceNameParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "resourceName can not be empty") String resourceName) { - super("ModifyUAICensorResourceName"); - this.region = region; - this.zone = zone; - this.resourceId = resourceId; - this.resourceName = resourceName; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameResult.java deleted file mode 100644 index a73ec4d4..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceNameResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :修改UAI安全审查资源名称 - * @Author : codezhang - * @Date : 2019-04-17 14:34 - **/ -public class ModifyUAICensorResourceNameResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoParam.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoParam.java deleted file mode 100644 index e8a20608..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoParam.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 更改UAI安全审查资源对象存储信息 - * resource 指定了toframe时候才能使用 - * @Author : codezhang - * @Date : 2019-04-17 15:14 - **/ -public class ModifyUAICensorResourceOssInfoParam extends BaseRequestParam { - - /** - * 地域 - */ - @UcloudParam("Region") - @NotEmpty(message = "region can not be empty") - private String region; - - /** - * 可用区 - */ - @UcloudParam("Zone") - @NotEmpty(message = "zone can not be empty") - private String zone; - - /** - * 待修改资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的对象存储访问公钥或token - */ - @NotEmpty(message = "OssPublicKey can not be empty") - @UcloudParam("OssPublicKey") - private String ossPublicKey; - - /** - * 对象存储访问私钥或token - */ - @NotEmpty(message = "ossPrivateKey can not be empty") - @UcloudParam("OssPrivateKey") - private String ossPrivateKey; - - public ModifyUAICensorResourceOssInfoParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "zone can not be empty") String zone, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "OssPublicKey can not be empty") String ossPublicKey, - @NotEmpty(message = "ossPrivateKey can not be empty") String ossPrivateKey) { - super("ModifyUAICensorResourceOssInfo"); - this.region = region; - this.zone = zone; - this.resourceId = resourceId; - this.ossPublicKey = ossPublicKey; - this.ossPrivateKey = ossPrivateKey; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getOssPublicKey() { - return ossPublicKey; - } - - public void setOssPublicKey(String ossPublicKey) { - this.ossPublicKey = ossPublicKey; - } - - public String getOssPrivateKey() { - return ossPrivateKey; - } - - public void setOssPrivateKey(String ossPrivateKey) { - this.ossPrivateKey = ossPrivateKey; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoResult.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoResult.java deleted file mode 100644 index 2adc328e..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/ModifyUAICensorResourceOssInfoResult.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.ucloud.censor.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description : 更改UAI安全审查资源对象存储信息 - * resource 指定了toframe时候才能使用 - * @Author : codezhang - * @Date : 2019-04-17 15:23 - **/ -public class ModifyUAICensorResourceOssInfoResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorDetailRequestInfo.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorDetailRequestInfo.java deleted file mode 100644 index 37eb8066..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorDetailRequestInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.ucloud.censor.model; - -import com.google.gson.annotations.SerializedName; - -/** - * @Description : UAI安全审查请求的具体分布信息 - * @Author : codezhang - * @Date : 2019-04-18 17:23 - **/ -public class UAICensorDetailRequestInfo { - - /** - * 开始时间,Unix时间戳形式 - */ - @SerializedName("BeginTime") - private Long beginTime; - - /** - * 结束时间,Unix时间戳形式 - */ - @SerializedName("EndTime") - private Long endTime; - - /** - * 总请求数 - */ - @SerializedName("TotalRequest") - private Integer totalRequest; - - /** - * 成功请求数 - */ - @SerializedName("SuccRequest") - private Integer successRequest; - - /** - * 失败请求数 - */ - @SerializedName("FailRequest") - private Integer failedRequest; - - /** - * 请求最大耗时(单位ms) - */ - @SerializedName("MaxRequestTime") - private Integer maxRequestTime; - - /** - * 请求最小耗时(单位ms) - */ - @SerializedName("MinRequestTime") - private Integer minRequestTime; - - /** - * 请求平均耗时(单位ms) - */ - @SerializedName("AvgRequestTime") - private Integer avgRequestTime; -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceInfo.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceInfo.java deleted file mode 100644 index 332273b9..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceInfo.java +++ /dev/null @@ -1,97 +0,0 @@ -package cn.ucloud.censor.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : UAI内容审查资源信息 - * @Author : codezhang - * @Date : 2019-04-17 14:12 - **/ -public class UAICensorResourceInfo { - - /** - * 资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - /** - * 资源名称 - */ - @SerializedName("ResourceName") - private String resourceName; - - /** - * 资源备注 - */ - @SerializedName("ResourceMemo") - private String resourceMemo; - - /** - * 资源类型 - */ - @SerializedName("ResourceType") - private List resourceType; - - /** - * 资源状态 - */ - @SerializedName("Status") - private String status; - - /** - * 资源创建时间 - */ - @SerializedName("CreateTime") - private Integer createTime; - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } - - public List getResourceType() { - return resourceType; - } - - public void setResourceType(List resourceType) { - this.resourceType = resourceType; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getCreateTime() { - return createTime; - } - - public void setCreateTime(Integer createTime) { - this.createTime = createTime; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRecordInfo.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRecordInfo.java deleted file mode 100644 index 20ef84fd..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRecordInfo.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.ucloud.censor.model; - -import com.google.gson.annotations.SerializedName; - -/** - * @Description : UAI安全审查资源请求记录信息 - * @Author : codezhang - * @Date : 2019-04-18 16:45 - **/ -public class UAICensorResourceRecordInfo { - - /** - * 资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - /** - * 资源状态 - */ - @SerializedName("Status") - private String status; - - /** - * 审查请求数 - */ - @SerializedName("CensorCount") - private Integer censorCount; - - /** - * 最新请求记录创建时间,Unix时间戳形式 - */ - @SerializedName("LatestRecordTime") - private Long latestRecordTime; - - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getCensorCount() { - return censorCount; - } - - public void setCensorCount(Integer censorCount) { - this.censorCount = censorCount; - } - - public Long getLatestRecordTime() { - return latestRecordTime; - } - - public void setLatestRecordTime(Long latestRecordTime) { - this.latestRecordTime = latestRecordTime; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRequestInfo.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRequestInfo.java deleted file mode 100644 index f7daa836..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceRequestInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.censor.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : UAI安全审查资源请求信息 - * @Author : codezhang - * @Date : 2019-04-18 17:27 - **/ -public class UAICensorResourceRequestInfo { - - /** - * 请求API名称 - */ - @SerializedName("ApiName") - private String apiName; - - /** - * 请求分布信息 - */ - @SerializedName("DataSet") - private List requestInfos; - - public String getApiName() { - return apiName; - } - - public void setApiName(String apiName) { - this.apiName = apiName; - } - - public List getRequestInfos() { - return requestInfos; - } - - public void setRequestInfos(List requestInfos) { - this.requestInfos = requestInfos; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceTypeInfo.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceTypeInfo.java deleted file mode 100644 index e3e48b91..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/model/UAICensorResourceTypeInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -package cn.ucloud.censor.model; - -import com.google.gson.annotations.SerializedName; - -/** - * @Description : UAI安全审查资源类型信息 - * @Author : codezhang - * @Date : 2019-04-17 10:44 - **/ -public class UAICensorResourceTypeInfo { - - - /** - * 资源类型ID - */ - @SerializedName("ResourceTypeId") - private Integer resourceTypeId; - - /** - * 资源类型名称 - */ - @SerializedName("ResourceTypeName") - private String resourceTypeName; - - public Integer getResourceTypeId() { - return resourceTypeId; - } - - public void setResourceTypeId(Integer resourceTypeId) { - this.resourceTypeId = resourceTypeId; - } - - public String getResourceTypeName() { - return resourceTypeName; - } - - public void setResourceTypeName(String resourceTypeName) { - this.resourceTypeName = resourceTypeName; - } -} diff --git a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/pojo/CensorConfig.java b/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/pojo/CensorConfig.java deleted file mode 100644 index 93d9e8d5..00000000 --- a/ucloud-sdk-java-censor/src/main/java/cn/ucloud/censor/pojo/CensorConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.ucloud.censor.pojo; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.UcloudConfig; - -/** - * @Description : censor 配置类 - * @Author : codezhang - * @Date : 2019-04-17 10:39 - **/ -public class CensorConfig extends UcloudConfig { - - public CensorConfig(Account account) { - super(account); - } -} diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/CreateUAICensorResourceTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/CreateUAICensorResourceTest.java deleted file mode 100644 index facdcd3f..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/CreateUAICensorResourceTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.CreateUAICensorResourceParam; -import cn.ucloud.censor.model.CreateUAICensorResourceResult; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeParam; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:05 - **/ -public class CreateUAICensorResourceTest { - - private CensorClient client; - - private CreateUAICensorResourceParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - List ids = new ArrayList<>(); - ids.add(0); - param = new CreateUAICensorResourceParam(region,zone,ids); - param.setProjectId(projectId); - param.setResourceMemo("demoMemo"); - param.setResourceName("demoName"); - } - - @Test - public void createUAICensorResource() { - try { - CreateUAICensorResourceResult result = - client.createUAICensorResource(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/DeleteUAICensorResourceTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/DeleteUAICensorResourceTest.java deleted file mode 100644 index 9a71c777..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/DeleteUAICensorResourceTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.DeleteUAICensorResourceParam; -import cn.ucloud.censor.model.DeleteUAICensorResourceResult; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:43 - **/ -public class DeleteUAICensorResourceTest { - - private CensorClient client; - - private DeleteUAICensorResourceParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - String resourceId = "uaicensor-aqlfqidb"; - param = new DeleteUAICensorResourceParam(region, zone, resourceId); - param.setProjectId(projectId); - } - - @Test - public void deleteUAICensorResource() { - try { - DeleteUAICensorResourceResult result = - client.deleteUAICensorResource(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorAvailResourceTypeTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorAvailResourceTypeTest.java deleted file mode 100644 index 6075fb4e..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorAvailResourceTypeTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeParam; -import cn.ucloud.censor.model.GetUAICensorAvailResourceTypeResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 10:52 - **/ -public class GetUAICensorAvailResourceTypeTest { - - private CensorClient client; - - private GetUAICensorAvailResourceTypeParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - param = new GetUAICensorAvailResourceTypeParam(region,zone); - param.setProjectId(projectId); - } - - @Test - public void getUAICensorAvailResourceType() { - try { - GetUAICensorAvailResourceTypeResult result = - client.getUAICensorAvailResourceType(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceListTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceListTest.java deleted file mode 100644 index e6eef4ee..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceListTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.GetUAICensorResourceListParam; -import cn.ucloud.censor.model.GetUAICensorResourceListResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:17 - **/ -public class GetUAICensorResourceListTest { - - private CensorClient client; - - private GetUAICensorResourceListParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - param = new GetUAICensorResourceListParam(region, zone); - param.setProjectId(projectId); - } - - @Test - public void getUAICensorResourceList() { - try { - GetUAICensorResourceListResult result = - client.getUAICensorResourceList(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceMetricInfoTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceMetricInfoTest.java deleted file mode 100644 index a5bff503..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceMetricInfoTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.CreateUAICensorResourceResult; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceMetricInfoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-18 17:33 - **/ -public class GetUAICensorResourceMetricInfoTest { - private CensorClient client; - - private GetUAICensorResourceMetricInfoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - Long beginTime = 1555557017L; - Long endTime = 1555578617L; - String resourceId = "uaicensor-nkh1osfy"; - param = new GetUAICensorResourceMetricInfoParam(region, beginTime, endTime,resourceId); - param.setProjectId(projectId); - } - - @Test - public void getUAICensorResourceMetricInfo() { - try { - GetUAICensorResourceMetricInfoResult result = - client.getUAICensorResourceMetricInfo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceRecordInfoTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceRecordInfoTest.java deleted file mode 100644 index 35161d89..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/GetUAICensorResourceRecordInfoTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoParam; -import cn.ucloud.censor.model.GetUAICensorResourceRecordInfoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-18 17:07 - **/ -public class GetUAICensorResourceRecordInfoTest { - - private CensorClient client; - - private GetUAICensorResourceRecordInfoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - Long beginTime = 1555557017L; - Long endTime = 1555638570L; - param = new GetUAICensorResourceRecordInfoParam(region,zone,beginTime,endTime); - param.setProjectId(projectId); - } - - @Test - public void getUAICensorResourceRecordInfo() { - try { - GetUAICensorResourceRecordInfoResult result = - client.getUAICensorResourceRecordInfo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/JSONComparator.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/JSONComparator.java deleted file mode 100644 index 50ac3719..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/JSONComparator.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-03-05 21:32 - **/ -public class JSONComparator { - - private static final Logger logger = LoggerFactory.getLogger(JSONComparator.class.getName()); - - public static void jsonComparator(BaseResponseResult result) { - try { - Gson gson = new GsonBuilder().serializeNulls().create(); - logger.info("result 2 json:{}", gson.toJson(result)); - JSONAssert.assertEquals(result.getResponseContent(), gson.toJson(result), JSONCompareMode.LENIENT); - } catch (Exception e) { - assertNull(e); - } - } - -} diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceMemoTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceMemoTest.java deleted file mode 100644 index c00d3124..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceMemoTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceMemoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:27 - **/ -public class ModifyUAICensorResourceMemoTest { - - private CensorClient client; - - private ModifyUAICensorResourceMemoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - String resourceId = "uaicensor-42yuglvf"; - String resourceMemo = "demo"; - param = new ModifyUAICensorResourceMemoParam(region, zone, resourceId,resourceMemo); - param.setProjectId(projectId); - } - - @Test - public void modifyUAICensorResourceMemo() { - try { - ModifyUAICensorResourceMemoResult result = - client.modifyUAICensorResourceMemo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceNameTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceNameTest.java deleted file mode 100644 index 122de5bd..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceNameTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.ModifyUAICensorResourceNameParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceNameResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 14:36 - **/ -public class ModifyUAICensorResourceNameTest { - - private CensorClient client; - - private ModifyUAICensorResourceNameParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - String resourceId = "uaicensor-42yuglvf"; - String resourceName = "demoName"; - param = new ModifyUAICensorResourceNameParam(region, zone, resourceId, resourceName); - param.setProjectId(projectId); - } - - @Test - public void modifyUAICensorResourceName() { - try { - ModifyUAICensorResourceNameResult result = - client.modifyUAICensorResourceName(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceOssInfoTest.java b/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceOssInfoTest.java deleted file mode 100644 index 8d816d6e..00000000 --- a/ucloud-sdk-java-censor/src/test/java/cn/ucloud/censor/client/ModifyUAICensorResourceOssInfoTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.ucloud.censor.client; - -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoParam; -import cn.ucloud.censor.model.ModifyUAICensorResourceOssInfoResult; -import cn.ucloud.censor.pojo.CensorConfig; -import cn.ucloud.common.pojo.Account; -import org.junit.Before; -import org.junit.Test; - - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 15:25 - **/ -public class ModifyUAICensorResourceOssInfoTest { - - private CensorClient client; - - private ModifyUAICensorResourceOssInfoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultCensorClient(new CensorConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String zone = "cn-bj2-04"; - String ossPublicKey = "xxx"; - String ossPrivateKey = "xxxxxx"; - String resourceId = "uaicensor-tebnw4ae"; - param = new ModifyUAICensorResourceOssInfoParam(region,zone,resourceId,ossPublicKey,ossPrivateKey); - param.setProjectId(projectId); - } - - @Test - public void modifyUAICensorResourceOssInfo() { - try { - ModifyUAICensorResourceOssInfoResult result = - client.modifyUAICensorResourceOssInfo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-cloudwatch/pom.xml b/ucloud-sdk-java-cloudwatch/pom.xml new file mode 100644 index 00000000..80c0512e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/pom.xml @@ -0,0 +1,49 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-java-cloudwatch + ucloud-sdk-java + 1.2.51-release + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + + com.google.code.gson + gson + + + + commons-codec + commons-codec + + + org.apache.commons + commons-lang3 + + + + junit + junit + test + + + + org.slf4j + slf4j-simple + provided + + + diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClient.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClient.java new file mode 100644 index 00000000..130dab35 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClient.java @@ -0,0 +1,260 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.client; + +import cn.ucloud.cloudwatch.models.BindAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.BindAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.DeleteAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.DeleteAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.EnableAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.EnableAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.GetProductMetricsRequest; +import cn.ucloud.cloudwatch.models.GetProductMetricsResponse; +import cn.ucloud.cloudwatch.models.ListAlertRecordRequest; +import cn.ucloud.cloudwatch.models.ListAlertRecordResponse; +import cn.ucloud.cloudwatch.models.ListAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.ListAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.ListAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.ListAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.ListMonitorProductRequest; +import cn.ucloud.cloudwatch.models.ListMonitorProductResponse; +import cn.ucloud.cloudwatch.models.ModifyAlertStrategyRemarkRequest; +import cn.ucloud.cloudwatch.models.ModifyAlertStrategyRemarkResponse; +import cn.ucloud.cloudwatch.models.QueryMetricDataSetRequest; +import cn.ucloud.cloudwatch.models.QueryMetricDataSetResponse; +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryRequest; +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryResponse; +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyTemplateResponse; +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; + +/** This client is used to call actions of **CloudWatch** service */ +public class CloudWatchClient extends DefaultClient implements CloudWatchClientInterface { + public CloudWatchClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * BindAlertStrategy - 绑定告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindAlertStrategyResponse bindAlertStrategy(BindAlertStrategyRequest request) + throws UCloudException { + request.setAction("BindAlertStrategy"); + return (BindAlertStrategyResponse) this.invoke(request, BindAlertStrategyResponse.class); + } + + /** + * CreateAlertStrategy - 创建告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateAlertStrategyResponse createAlertStrategy(CreateAlertStrategyRequest request) + throws UCloudException { + request.setAction("CreateAlertStrategy"); + return (CreateAlertStrategyResponse) + this.invoke(request, CreateAlertStrategyResponse.class); + } + + /** + * CreateAlertStrategyTemplate - 新建条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateAlertStrategyTemplateResponse createAlertStrategyTemplate( + CreateAlertStrategyTemplateRequest request) throws UCloudException { + request.setAction("CreateAlertStrategyTemplate"); + return (CreateAlertStrategyTemplateResponse) + this.invoke(request, CreateAlertStrategyTemplateResponse.class); + } + + /** + * DeleteAlertStrategyTemplate - 删除告警条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteAlertStrategyTemplateResponse deleteAlertStrategyTemplate( + DeleteAlertStrategyTemplateRequest request) throws UCloudException { + request.setAction("DeleteAlertStrategyTemplate"); + return (DeleteAlertStrategyTemplateResponse) + this.invoke(request, DeleteAlertStrategyTemplateResponse.class); + } + + /** + * EnableAlertStrategy - 是否启用告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public EnableAlertStrategyResponse enableAlertStrategy(EnableAlertStrategyRequest request) + throws UCloudException { + request.setAction("EnableAlertStrategy"); + return (EnableAlertStrategyResponse) + this.invoke(request, EnableAlertStrategyResponse.class); + } + + /** + * GetProductMetrics - 获取云产品关联的指标列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetProductMetricsResponse getProductMetrics(GetProductMetricsRequest request) + throws UCloudException { + request.setAction("GetProductMetrics"); + return (GetProductMetricsResponse) this.invoke(request, GetProductMetricsResponse.class); + } + + /** + * ListAlertRecord - 告警记录 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertRecordResponse listAlertRecord(ListAlertRecordRequest request) + throws UCloudException { + request.setAction("ListAlertRecord"); + return (ListAlertRecordResponse) this.invoke(request, ListAlertRecordResponse.class); + } + + /** + * ListAlertStrategy - 获取告警策略列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertStrategyResponse listAlertStrategy(ListAlertStrategyRequest request) + throws UCloudException { + request.setAction("ListAlertStrategy"); + return (ListAlertStrategyResponse) this.invoke(request, ListAlertStrategyResponse.class); + } + + /** + * ListAlertStrategyTemplate - 条件模板列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertStrategyTemplateResponse listAlertStrategyTemplate( + ListAlertStrategyTemplateRequest request) throws UCloudException { + request.setAction("ListAlertStrategyTemplate"); + return (ListAlertStrategyTemplateResponse) + this.invoke(request, ListAlertStrategyTemplateResponse.class); + } + + /** + * ListMonitorProduct - 获取监控对象类型列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListMonitorProductResponse listMonitorProduct(ListMonitorProductRequest request) + throws UCloudException { + request.setAction("ListMonitorProduct"); + return (ListMonitorProductResponse) this.invoke(request, ListMonitorProductResponse.class); + } + + /** + * ModifyAlertStrategyRemark - 修改告警策略备注 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyAlertStrategyRemarkResponse modifyAlertStrategyRemark( + ModifyAlertStrategyRemarkRequest request) throws UCloudException { + request.setAction("ModifyAlertStrategyRemark"); + return (ModifyAlertStrategyRemarkResponse) + this.invoke(request, ModifyAlertStrategyRemarkResponse.class); + } + + /** + * QueryMetricDataSet - 查询监控指标数据集 + * + * @param request Request object + * @throws UCloudException Exception + */ + public QueryMetricDataSetResponse queryMetricDataSet(QueryMetricDataSetRequest request) + throws UCloudException { + request.setAction("QueryMetricDataSet"); + return (QueryMetricDataSetResponse) this.invoke(request, QueryMetricDataSetResponse.class); + } + + /** + * QueryMetricDataSummary - 获取资源看图属性列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public QueryMetricDataSummaryResponse queryMetricDataSummary( + QueryMetricDataSummaryRequest request) throws UCloudException { + request.setAction("QueryMetricDataSummary"); + return (QueryMetricDataSummaryResponse) + this.invoke(request, QueryMetricDataSummaryResponse.class); + } + + /** + * UnBindAlertStrategy - 解绑告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnBindAlertStrategyResponse unBindAlertStrategy(UnBindAlertStrategyRequest request) + throws UCloudException { + request.setAction("UnBindAlertStrategy"); + return (UnBindAlertStrategyResponse) + this.invoke(request, UnBindAlertStrategyResponse.class); + } + + /** + * UpdateAlertStrategy - 更新告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateAlertStrategyResponse updateAlertStrategy(UpdateAlertStrategyRequest request) + throws UCloudException { + request.setAction("UpdateAlertStrategy"); + return (UpdateAlertStrategyResponse) + this.invoke(request, UpdateAlertStrategyResponse.class); + } + + /** + * UpdateAlertStrategyTemplate - 编辑条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateAlertStrategyTemplateResponse updateAlertStrategyTemplate( + UpdateAlertStrategyTemplateRequest request) throws UCloudException { + request.setAction("UpdateAlertStrategyTemplate"); + return (UpdateAlertStrategyTemplateResponse) + this.invoke(request, UpdateAlertStrategyTemplateResponse.class); + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClientInterface.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClientInterface.java new file mode 100644 index 00000000..6fdfdab5 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/client/CloudWatchClientInterface.java @@ -0,0 +1,197 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.client; + +import cn.ucloud.cloudwatch.models.BindAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.BindAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.CreateAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.DeleteAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.DeleteAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.EnableAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.EnableAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.GetProductMetricsRequest; +import cn.ucloud.cloudwatch.models.GetProductMetricsResponse; +import cn.ucloud.cloudwatch.models.ListAlertRecordRequest; +import cn.ucloud.cloudwatch.models.ListAlertRecordResponse; +import cn.ucloud.cloudwatch.models.ListAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.ListAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.ListAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.ListAlertStrategyTemplateResponse; +import cn.ucloud.cloudwatch.models.ListMonitorProductRequest; +import cn.ucloud.cloudwatch.models.ListMonitorProductResponse; +import cn.ucloud.cloudwatch.models.ModifyAlertStrategyRemarkRequest; +import cn.ucloud.cloudwatch.models.ModifyAlertStrategyRemarkResponse; +import cn.ucloud.cloudwatch.models.QueryMetricDataSetRequest; +import cn.ucloud.cloudwatch.models.QueryMetricDataSetResponse; +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryRequest; +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryResponse; +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyRequest; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyResponse; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyTemplateRequest; +import cn.ucloud.cloudwatch.models.UpdateAlertStrategyTemplateResponse; +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; + +/** This client is used to call actions of **CloudWatch** service */ +public interface CloudWatchClientInterface extends Client { + + /** + * BindAlertStrategy - 绑定告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindAlertStrategyResponse bindAlertStrategy(BindAlertStrategyRequest request) + throws UCloudException; + + /** + * CreateAlertStrategy - 创建告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateAlertStrategyResponse createAlertStrategy(CreateAlertStrategyRequest request) + throws UCloudException; + + /** + * CreateAlertStrategyTemplate - 新建条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateAlertStrategyTemplateResponse createAlertStrategyTemplate( + CreateAlertStrategyTemplateRequest request) throws UCloudException; + + /** + * DeleteAlertStrategyTemplate - 删除告警条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteAlertStrategyTemplateResponse deleteAlertStrategyTemplate( + DeleteAlertStrategyTemplateRequest request) throws UCloudException; + + /** + * EnableAlertStrategy - 是否启用告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public EnableAlertStrategyResponse enableAlertStrategy(EnableAlertStrategyRequest request) + throws UCloudException; + + /** + * GetProductMetrics - 获取云产品关联的指标列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetProductMetricsResponse getProductMetrics(GetProductMetricsRequest request) + throws UCloudException; + + /** + * ListAlertRecord - 告警记录 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertRecordResponse listAlertRecord(ListAlertRecordRequest request) + throws UCloudException; + + /** + * ListAlertStrategy - 获取告警策略列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertStrategyResponse listAlertStrategy(ListAlertStrategyRequest request) + throws UCloudException; + + /** + * ListAlertStrategyTemplate - 条件模板列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListAlertStrategyTemplateResponse listAlertStrategyTemplate( + ListAlertStrategyTemplateRequest request) throws UCloudException; + + /** + * ListMonitorProduct - 获取监控对象类型列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListMonitorProductResponse listMonitorProduct(ListMonitorProductRequest request) + throws UCloudException; + + /** + * ModifyAlertStrategyRemark - 修改告警策略备注 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyAlertStrategyRemarkResponse modifyAlertStrategyRemark( + ModifyAlertStrategyRemarkRequest request) throws UCloudException; + + /** + * QueryMetricDataSet - 查询监控指标数据集 + * + * @param request Request object + * @throws UCloudException Exception + */ + public QueryMetricDataSetResponse queryMetricDataSet(QueryMetricDataSetRequest request) + throws UCloudException; + + /** + * QueryMetricDataSummary - 获取资源看图属性列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public QueryMetricDataSummaryResponse queryMetricDataSummary( + QueryMetricDataSummaryRequest request) throws UCloudException; + + /** + * UnBindAlertStrategy - 解绑告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnBindAlertStrategyResponse unBindAlertStrategy(UnBindAlertStrategyRequest request) + throws UCloudException; + + /** + * UpdateAlertStrategy - 更新告警策略 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateAlertStrategyResponse updateAlertStrategy(UpdateAlertStrategyRequest request) + throws UCloudException; + + /** + * UpdateAlertStrategyTemplate - 编辑条件模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateAlertStrategyTemplateResponse updateAlertStrategyTemplate( + UpdateAlertStrategyTemplateRequest request) throws UCloudException; +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyRequest.java new file mode 100644 index 00000000..910ec4f2 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class BindAlertStrategyRequest extends Request { + + /** 项目ID */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警策略id数组 */ + @NotEmpty + @UCloudParam("AlertStrategyIDs") + private List alertStrategyIDs; + + /** 资源数组 */ + @NotEmpty + @UCloudParam("Resources") + private List resources; + + /** 产品类型名称 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getAlertStrategyIDs() { + return alertStrategyIDs; + } + + public void setAlertStrategyIDs(List alertStrategyIDs) { + this.alertStrategyIDs = alertStrategyIDs; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyResponse.java new file mode 100644 index 00000000..e61ddf58 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/BindAlertStrategyResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + + +import cn.ucloud.common.response.Response; + +public class BindAlertStrategyResponse extends Response {} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyRequest.java new file mode 100644 index 00000000..7d36af4e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyRequest.java @@ -0,0 +1,310 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class CreateAlertStrategyRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警策略名称。最大长度255个字符 */ + @NotEmpty + @UCloudParam("Name") + private String name; + + /** 产品类型。参考ListMonitorProduct获取监控对象类型列表 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** 绑定资源类型 1 资源组 2 资源 */ + @NotEmpty + @UCloudParam("ObjectType") + private Integer objectType; + + /** 条件设置方式 1. 手动配置 2.选择模版 */ + @NotEmpty + @UCloudParam("ConfigMode") + private Integer configMode; + + /** 绑定资源,对应绑定资源类型ObjectType=2 */ + @UCloudParam("Resources") + private List resources; + + /** 绑定资源组,对应绑定资源类型ObjectType=1 */ + @UCloudParam("ResourceGroupIDs") + private List resourceGroupIDs; + + /** 模板id.对应TemplateId=2 */ + @UCloudParam("TemplateId") + private Integer templateId; + + /** */ + @UCloudParam("RuleSet") + private List ruleSet; + + /** 通知类型 通知组 group 通知人 user */ + @UCloudParam("NotifyType") + private String notifyType; + + /** 通知人id */ + @UCloudParam("NotifyUserIDs") + private List notifyUserIDs; + + /** 通知人组id */ + @UCloudParam("NotifyGroupIDs") + private List notifyGroupIDs; + + /** 通知渠道 短信sms 邮件email 回调webhook */ + @UCloudParam("NotifyChannelDs") + private List notifyChannelDs; + + /** 通知渠道回调webhook 回调语言 中文cn 英文en */ + @UCloudParam("CallbackLanguage") + private String callbackLanguage; + + /** 回调语言url */ + @UCloudParam("CallbackUrls") + private List callbackUrls; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getObjectType() { + return objectType; + } + + public void setObjectType(Integer objectType) { + this.objectType = objectType; + } + + public Integer getConfigMode() { + return configMode; + } + + public void setConfigMode(Integer configMode) { + this.configMode = configMode; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public List getResourceGroupIDs() { + return resourceGroupIDs; + } + + public void setResourceGroupIDs(List resourceGroupIDs) { + this.resourceGroupIDs = resourceGroupIDs; + } + + public Integer getTemplateId() { + return templateId; + } + + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public String getNotifyType() { + return notifyType; + } + + public void setNotifyType(String notifyType) { + this.notifyType = notifyType; + } + + public List getNotifyUserIDs() { + return notifyUserIDs; + } + + public void setNotifyUserIDs(List notifyUserIDs) { + this.notifyUserIDs = notifyUserIDs; + } + + public List getNotifyGroupIDs() { + return notifyGroupIDs; + } + + public void setNotifyGroupIDs(List notifyGroupIDs) { + this.notifyGroupIDs = notifyGroupIDs; + } + + public List getNotifyChannelDs() { + return notifyChannelDs; + } + + public void setNotifyChannelDs(List notifyChannelDs) { + this.notifyChannelDs = notifyChannelDs; + } + + public String getCallbackLanguage() { + return callbackLanguage; + } + + public void setCallbackLanguage(String callbackLanguage) { + this.callbackLanguage = callbackLanguage; + } + + public List getCallbackUrls() { + return callbackUrls; + } + + public void setCallbackUrls(List callbackUrls) { + this.callbackUrls = callbackUrls; + } + + public static class RuleSet extends Request { + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @UCloudParam("MetricID") + private Integer metricID; + + /** 阈值比较方式。 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @UCloudParam("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @UCloudParam("ThresholdValue") + private Integer thresholdValue; + + /** 触发次数 */ + @UCloudParam("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @UCloudParam("SendPeriodType") + private String sendPeriodType; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @UCloudParam("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @UCloudParam("Status") + private Integer status; + + /** 沉默周期(告警周期选择为连续时必填) */ + @UCloudParam("SendInterval") + private Integer sendInterval; + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Integer getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Integer thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyResponse.java new file mode 100644 index 00000000..362e0e77 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateAlertStrategyResponse extends Response { + + /** 创建告警策略返回对象 */ + @SerializedName("Data") + private AlertStrategyId data; + + public AlertStrategyId getData() { + return data; + } + + public void setData(AlertStrategyId data) { + this.data = data; + } + + public static class AlertStrategyId extends Response { + + /** 告警策略id */ + @SerializedName("AlertStrategyID") + private Integer alertStrategyID; + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateRequest.java new file mode 100644 index 00000000..5f8ecef8 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateRequest.java @@ -0,0 +1,195 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class CreateAlertStrategyTemplateRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警模板名称。最大长度64个字符 */ + @NotEmpty + @UCloudParam("Name") + private String name; + + /** 产品类型。参考ListMonitorProduct获取监控对象类型列表 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** */ + @UCloudParam("RuleSet") + private List ruleSet; + + /** 备注 */ + @UCloudParam("Remark") + private String remark; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public static class RuleSet extends Request { + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @NotEmpty + @UCloudParam("MetricID") + private Integer metricID; + + /** 阈值比较方式。 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @NotEmpty + @UCloudParam("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @NotEmpty + @UCloudParam("ThresholdValue") + private Integer thresholdValue; + + /** 触发次数 */ + @NotEmpty + @UCloudParam("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @NotEmpty + @UCloudParam("SendPeriodType") + private String sendPeriodType; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @NotEmpty + @UCloudParam("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @NotEmpty + @UCloudParam("Status") + private Integer status; + + /** 沉默周期(告警周期选择为连续时必填) */ + @UCloudParam("SendInterval") + private Integer sendInterval; + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Integer getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Integer thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateResponse.java new file mode 100644 index 00000000..243fee0c --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/CreateAlertStrategyTemplateResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateAlertStrategyTemplateResponse extends Response { + + /** 创建告警模板返回对象 */ + @SerializedName("Data") + private AlertTemplate data; + + public AlertTemplate getData() { + return data; + } + + public void setData(AlertTemplate data) { + this.data = data; + } + + public static class AlertTemplate extends Response { + + /** 告警模板ID */ + @SerializedName("TemplateID") + private Integer templateID; + + public Integer getTemplateID() { + return templateID; + } + + public void setTemplateID(Integer templateID) { + this.templateID = templateID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateRequest.java new file mode 100644 index 00000000..7ac62739 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateRequest.java @@ -0,0 +1,52 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DeleteAlertStrategyTemplateRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警模板ID(支持批量删除) */ + @NotEmpty + @UCloudParam("TemplateID") + private List templateID; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getTemplateID() { + return templateID; + } + + public void setTemplateID(List templateID) { + this.templateID = templateID; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateResponse.java new file mode 100644 index 00000000..8fe1b412 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/DeleteAlertStrategyTemplateResponse.java @@ -0,0 +1,50 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DeleteAlertStrategyTemplateResponse extends Response { + + /** 删除告警模板返回对象 */ + @SerializedName("Data") + private DelAlertTemplate data; + + public DelAlertTemplate getData() { + return data; + } + + public void setData(DelAlertTemplate data) { + this.data = data; + } + + public static class DelAlertTemplate extends Response { + + /** 模板ID */ + @SerializedName("TemplateID") + private List templateID; + + public List getTemplateID() { + return templateID; + } + + public void setTemplateID(List templateID) { + this.templateID = templateID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyRequest.java new file mode 100644 index 00000000..9e29760a --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyRequest.java @@ -0,0 +1,64 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class EnableAlertStrategyRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警策略id */ + @NotEmpty + @UCloudParam("AlertStrategyID") + private Integer alertStrategyID; + + /** 启用状态0 停用 1 启用 */ + @NotEmpty + @UCloudParam("Status") + private Integer status; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyResponse.java new file mode 100644 index 00000000..528ac1d1 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/EnableAlertStrategyResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class EnableAlertStrategyResponse extends Response { + + /** 返回数据 */ + @SerializedName("Data") + private AlertStrategyId data; + + public AlertStrategyId getData() { + return data; + } + + public void setData(AlertStrategyId data) { + this.data = data; + } + + public static class AlertStrategyId extends Response { + + /** 告警策略id */ + @SerializedName("AlertStrategyID") + private Integer alertStrategyID; + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsRequest.java new file mode 100644 index 00000000..29e01511 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsRequest.java @@ -0,0 +1,35 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetProductMetricsRequest extends Request { + + /** 云产品key 例如 uhost */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsResponse.java new file mode 100644 index 00000000..9683690b --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/GetProductMetricsResponse.java @@ -0,0 +1,482 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GetProductMetricsResponse extends Response { + + /** 返回数据 */ + @SerializedName("Data") + private GetProductMetricsRespData data; + + public GetProductMetricsRespData getData() { + return data; + } + + public void setData(GetProductMetricsRespData data) { + this.data = data; + } + + public static class ConversionRule extends Response { + + /** 来源 */ + @SerializedName("From") + private String from; + + /** 目标 */ + @SerializedName("To") + private String to; + + /** 转换因子 */ + @SerializedName("ConversionFactor") + private Integer conversionFactor; + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public String getTo() { + return to; + } + + public void setTo(String to) { + this.to = to; + } + + public Integer getConversionFactor() { + return conversionFactor; + } + + public void setConversionFactor(Integer conversionFactor) { + this.conversionFactor = conversionFactor; + } + } + + public static class GetProductMetricsRespData extends Response { + + /** 查询结果总数 */ + @SerializedName("Total") + private Integer total; + + /** 指标列表 */ + @SerializedName("List") + private List list; + + /** 单位转换信息 */ + @SerializedName("UnitConfigs") + private List unitConfigs; + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public List getUnitConfigs() { + return unitConfigs; + } + + public void setUnitConfigs(List unitConfigs) { + this.unitConfigs = unitConfigs; + } + } + + public static class Metirc extends Response { + + /** 云产品ID */ + @SerializedName("ProductType") + private Integer productType; + + /** 单位ID */ + @SerializedName("UnitID") + private Integer unitID; + + /** 指标ID */ + @SerializedName("MetricID") + private Integer metricID; + + /** 指标唯一标识 (uhost_cpu_usage) */ + @SerializedName("Metric") + private String metric; + + /** 指标英文名称 */ + @SerializedName("MetricEnName") + private String metricEnName; + + /** 指标中文名称 */ + @SerializedName("MetricChName") + private String metricChName; + + /** 指标英文描述 */ + @SerializedName("MetricEnDesc") + private String metricEnDesc; + + /** 指标中文描述 */ + @SerializedName("MetricChDesc") + private String metricChDesc; + + /** 指标分类/指标组 */ + @SerializedName("MetricGroup") + private String metricGroup; + + /** 上报频率毫秒 */ + @SerializedName("FrequencyMs") + private Integer frequencyMs; + + /** 单位 */ + @SerializedName("Unit") + private MetricUnit unit; + + /** 创建者 */ + @SerializedName("CreatedBy") + private String createdBy; + + /** 创建时间 */ + @SerializedName("CreatedAt") + private String createdAt; + + /** 修改者 */ + @SerializedName("UpdatedBy") + private String updatedBy; + + /** 修改时间 */ + @SerializedName("UpdatedAt") + private String updatedAt; + + public Integer getProductType() { + return productType; + } + + public void setProductType(Integer productType) { + this.productType = productType; + } + + public Integer getUnitID() { + return unitID; + } + + public void setUnitID(Integer unitID) { + this.unitID = unitID; + } + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public String getMetricEnName() { + return metricEnName; + } + + public void setMetricEnName(String metricEnName) { + this.metricEnName = metricEnName; + } + + public String getMetricChName() { + return metricChName; + } + + public void setMetricChName(String metricChName) { + this.metricChName = metricChName; + } + + public String getMetricEnDesc() { + return metricEnDesc; + } + + public void setMetricEnDesc(String metricEnDesc) { + this.metricEnDesc = metricEnDesc; + } + + public String getMetricChDesc() { + return metricChDesc; + } + + public void setMetricChDesc(String metricChDesc) { + this.metricChDesc = metricChDesc; + } + + public String getMetricGroup() { + return metricGroup; + } + + public void setMetricGroup(String metricGroup) { + this.metricGroup = metricGroup; + } + + public Integer getFrequencyMs() { + return frequencyMs; + } + + public void setFrequencyMs(Integer frequencyMs) { + this.frequencyMs = frequencyMs; + } + + public MetricUnit getUnit() { + return unit; + } + + public void setUnit(MetricUnit unit) { + this.unit = unit; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + } + + public static class MetricUnit extends Response { + + /** 单位id */ + @SerializedName("UnitID") + private Integer unitID; + + /** GroupId */ + @SerializedName("GroupId") + private Integer groupId; + + /** 单位英文名称 */ + @SerializedName("UnitEnName") + private String unitEnName; + + /** 单位中文名称 */ + @SerializedName("UnitChName") + private String unitChName; + + /** 单位描述 */ + @SerializedName("UnitDesc") + private String unitDesc; + + /** 转换因子 */ + @SerializedName("ConversionFactor") + private Integer conversionFactor; + + /** 创建人 */ + @SerializedName("CreatedBy") + private String createdBy; + + /** 修改人 */ + @SerializedName("UpdatedBy") + private String updatedBy; + + /** 创建时间 */ + @SerializedName("CreatedAt") + private String createdAt; + + /** 修改时间 */ + @SerializedName("UpdatedAt") + private String updatedAt; + + /** 删除时间 */ + @SerializedName("DeletedAt") + private Integer deletedAt; + + public Integer getUnitID() { + return unitID; + } + + public void setUnitID(Integer unitID) { + this.unitID = unitID; + } + + public Integer getGroupId() { + return groupId; + } + + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + + public String getUnitEnName() { + return unitEnName; + } + + public void setUnitEnName(String unitEnName) { + this.unitEnName = unitEnName; + } + + public String getUnitChName() { + return unitChName; + } + + public void setUnitChName(String unitChName) { + this.unitChName = unitChName; + } + + public String getUnitDesc() { + return unitDesc; + } + + public void setUnitDesc(String unitDesc) { + this.unitDesc = unitDesc; + } + + public Integer getConversionFactor() { + return conversionFactor; + } + + public void setConversionFactor(Integer conversionFactor) { + this.conversionFactor = conversionFactor; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public Integer getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(Integer deletedAt) { + this.deletedAt = deletedAt; + } + } + + public static class MetricUnitConfig extends Response { + + /** 指标中文名列表 */ + @SerializedName("UnitCnNames") + private List unitCnNames; + + /** 指标英文名列表 */ + @SerializedName("UnitEnNames") + private List unitEnNames; + + /** 转换因子 */ + @SerializedName("ConversionFactor") + private Integer conversionFactor; + + /** 转换规则 */ + @SerializedName("ConversionRules") + private List conversionRules; + + public List getUnitCnNames() { + return unitCnNames; + } + + public void setUnitCnNames(List unitCnNames) { + this.unitCnNames = unitCnNames; + } + + public List getUnitEnNames() { + return unitEnNames; + } + + public void setUnitEnNames(List unitEnNames) { + this.unitEnNames = unitEnNames; + } + + public Integer getConversionFactor() { + return conversionFactor; + } + + public void setConversionFactor(Integer conversionFactor) { + this.conversionFactor = conversionFactor; + } + + public List getConversionRules() { + return conversionRules; + } + + public void setConversionRules(List conversionRules) { + this.conversionRules = conversionRules; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordRequest.java new file mode 100644 index 00000000..e4ebf154 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordRequest.java @@ -0,0 +1,161 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListAlertRecordRequest extends Request { + + /** 项目ID。 */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 开始时间,查询告警记录开始时间(不支持查询距当前时间一年前的数据) */ + @NotEmpty + @UCloudParam("StartAt") + private Integer startAt; + + /** 结束时间,查询告警记录结束时间(查询开始时间和结束时间不能超过一个月) */ + @NotEmpty + @UCloudParam("EndAt") + private Integer endAt; + + /** 模糊查询(支持资源id模糊搜索) */ + @UCloudParam("Fuzzy") + private String fuzzy; + + /** */ + @UCloudParam("Filter") + private Filter filter; + + /** 排序(默认根据告警发生时间倒序) */ + @UCloudParam("OrderType") + private String orderType; + + /** 查询返回数量,默认值300,最大值:300。 */ + @UCloudParam("Limit") + private Integer limit; + + /** 数据偏移量 (默认0) */ + @UCloudParam("Offset") + private Integer offset; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Integer getStartAt() { + return startAt; + } + + public void setStartAt(Integer startAt) { + this.startAt = startAt; + } + + public Integer getEndAt() { + return endAt; + } + + public void setEndAt(Integer endAt) { + this.endAt = endAt; + } + + public String getFuzzy() { + return fuzzy; + } + + public void setFuzzy(String fuzzy) { + this.fuzzy = fuzzy; + } + + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public static class Filter extends Request { + + /** 产品类型,根据产品类型精确搜索对应的告警记录 */ + @UCloudParam("ProductTypes") + private List productTypes; + + /** 告警级别,根据告警级别精确搜索对应的告警记录 */ + @UCloudParam("Levels") + private List levels; + + /** 告警状态,根据告警状态精确搜索对应的告警记录 */ + @UCloudParam("Status") + private List status; + + public List getProductTypes() { + return productTypes; + } + + public void setProductTypes(List productTypes) { + this.productTypes = productTypes; + } + + public List getLevels() { + return levels; + } + + public void setLevels(List levels) { + this.levels = levels; + } + + public List getStatus() { + return status; + } + + public void setStatus(List status) { + this.status = status; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordResponse.java new file mode 100644 index 00000000..38f1a82b --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertRecordResponse.java @@ -0,0 +1,302 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListAlertRecordResponse extends Response { + + /** 告警记录集合 */ + @SerializedName("Data") + private List data; + + /** 告警记录总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public static class AlertRecord extends Response { + + /** 可用区 */ + @SerializedName("Region") + private String region; + + /** 告警记录RecordID */ + @SerializedName("RecordID") + private Integer recordID; + + /** 项目ProjectID */ + @SerializedName("ProjectID") + private Integer projectID; + + /** 告警记录触发告警策略名称 */ + @SerializedName("StrategyName") + private String strategyName; + + /** 产品类型 */ + @SerializedName("ProductType") + private Integer productType; + + /** 产品类型名称 */ + @SerializedName("ProductName") + private String productName; + + /** 资源id */ + @SerializedName("ResourceID") + private String resourceID; + + /** 指标id */ + @SerializedName("MetricID") + private Integer metricID; + + /** 指标名称 */ + @SerializedName("MetricName") + private String metricName; + + /** 指标单位名称 */ + @SerializedName("UnitName") + private String unitName; + + /** 告警记录触发告警策略Id */ + @SerializedName("StrategyID") + private Integer strategyID; + + /** 告警记录触发告警规则Id */ + @SerializedName("RuleID") + private Integer ruleID; + + /** 告警点tag信息 */ + @SerializedName("Tag") + private List tag; + + /** 告警当前值 */ + @SerializedName("Value") + private Integer value; + + /** 比较符 */ + @SerializedName("ThresholdCompare") + private Integer thresholdCompare; + + /** 告警阈值 */ + @SerializedName("ThresholdValue") + private Integer thresholdValue; + + /** 告警屏蔽规则id(如果配置了屏蔽规则,并且满足条件) */ + @SerializedName("ShieldRuleID") + private Integer shieldRuleID; + + /** 告警等级 */ + @SerializedName("Level") + private String level; + + /** 告警状态 */ + @SerializedName("Status") + private String status; + + /** 告警触发时间 */ + @SerializedName("StartAt") + private Integer startAt; + + /** 告警恢复时间 */ + @SerializedName("EndAt") + private Integer endAt; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public Integer getRecordID() { + return recordID; + } + + public void setRecordID(Integer recordID) { + this.recordID = recordID; + } + + public Integer getProjectID() { + return projectID; + } + + public void setProjectID(Integer projectID) { + this.projectID = projectID; + } + + public String getStrategyName() { + return strategyName; + } + + public void setStrategyName(String strategyName) { + this.strategyName = strategyName; + } + + public Integer getProductType() { + return productType; + } + + public void setProductType(Integer productType) { + this.productType = productType; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getResourceID() { + return resourceID; + } + + public void setResourceID(String resourceID) { + this.resourceID = resourceID; + } + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + this.metricName = metricName; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public Integer getStrategyID() { + return strategyID; + } + + public void setStrategyID(Integer strategyID) { + this.strategyID = strategyID; + } + + public Integer getRuleID() { + return ruleID; + } + + public void setRuleID(Integer ruleID) { + this.ruleID = ruleID; + } + + public List getTag() { + return tag; + } + + public void setTag(List tag) { + this.tag = tag; + } + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Integer getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Integer thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getShieldRuleID() { + return shieldRuleID; + } + + public void setShieldRuleID(Integer shieldRuleID) { + this.shieldRuleID = shieldRuleID; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Integer getStartAt() { + return startAt; + } + + public void setStartAt(Integer startAt) { + this.startAt = startAt; + } + + public Integer getEndAt() { + return endAt; + } + + public void setEndAt(Integer endAt) { + this.endAt = endAt; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyRequest.java new file mode 100644 index 00000000..5d485768 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyRequest.java @@ -0,0 +1,135 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListAlertStrategyRequest extends Request { + + /** 项目ID */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 模糊查询(支持告警策略名称模糊搜索) */ + @UCloudParam("Fuzzy") + private String fuzzy; + + /** */ + @UCloudParam("Filter") + private Filter filter; + + /** 资源id集合,根据资源id返回绑定的告警策略列表 */ + @UCloudParam("Resources") + private List resources; + + /** 查询返回数量,默认值300,最大值:300。 */ + @UCloudParam("Limit") + private Integer limit; + + /** 数据偏移量 (默认0) */ + @UCloudParam("Offset") + private Integer offset; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getFuzzy() { + return fuzzy; + } + + public void setFuzzy(String fuzzy) { + this.fuzzy = fuzzy; + } + + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public static class Filter extends Request { + + /** 产品类型,根据产品类型精确搜索对应的告警策略 */ + @UCloudParam("ProductTypes") + private List productTypes; + + /** 告警策略id,根据策略id获取告警策略列表 */ + @UCloudParam("AlertStrategyIDs") + private List alertStrategyIDs; + + /** 告警策略状态,根据告警策略状态精确搜索对应的告警策略 */ + @UCloudParam("Status") + private List status; + + public List getProductTypes() { + return productTypes; + } + + public void setProductTypes(List productTypes) { + this.productTypes = productTypes; + } + + public List getAlertStrategyIDs() { + return alertStrategyIDs; + } + + public void setAlertStrategyIDs(List alertStrategyIDs) { + this.alertStrategyIDs = alertStrategyIDs; + } + + public List getStatus() { + return status; + } + + public void setStatus(List status) { + this.status = status; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyResponse.java new file mode 100644 index 00000000..cfce2b0e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyResponse.java @@ -0,0 +1,437 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListAlertStrategyResponse extends Response { + + /** 告警策略集合 */ + @SerializedName("Data") + private List data; + + /** 告警策略总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 链路ID */ + @SerializedName("TraceId") + private String traceId; + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public String getTraceId() { + return traceId; + } + + public void setTraceId(String traceId) { + this.traceId = traceId; + } + + public static class AlertRule extends Response { + + /** 规则ID */ + @SerializedName("RuleID") + private Integer ruleID; + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @SerializedName("MetricID") + private Integer metricID; + + /** 指标名称 */ + @SerializedName("MetricName") + private String metricName; + + /** 阈值比较方式 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @SerializedName("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @SerializedName("ThresholdValue") + private Double thresholdValue; + + /** 触发次数 */ + @SerializedName("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @SerializedName("SendPeriodType") + private String sendPeriodType; + + /** 发送间隔 */ + @SerializedName("SendInterval") + private Integer sendInterval; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @SerializedName("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @SerializedName("Status") + private Integer status; + + /** 单位id */ + @SerializedName("UnitID") + private Integer unitID; + + /** 单位名称 */ + @SerializedName("UnitName") + private String unitName; + + public Integer getRuleID() { + return ruleID; + } + + public void setRuleID(Integer ruleID) { + this.ruleID = ruleID; + } + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + this.metricName = metricName; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Double getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Double thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getUnitID() { + return unitID; + } + + public void setUnitID(Integer unitID) { + this.unitID = unitID; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + } + + public static class AlertStrategy extends Response { + + /** 告警规则集合 */ + @SerializedName("RuleSet") + private List ruleSet; + + /** 告警策略Id */ + @SerializedName("AlertStrategyID") + private Integer alertStrategyID; + + /** 告警策略名称 */ + @SerializedName("Name") + private String name; + + /** 资源类型 */ + @SerializedName("ProductType") + private Integer productType; + + /** 资源类型名称 */ + @SerializedName("ProductKey") + private String productKey; + + /** 告警规则配置类型(基于模板配置、基于手工配置) */ + @SerializedName("ConfigMode") + private Integer configMode; + + /** 模板Id */ + @SerializedName("TemplateId") + private Integer templateId; + + /** 通知方式(通知组:group,通知人:user) */ + @SerializedName("NotifyType") + private String notifyType; + + /** 通知人用户id集合 */ + @SerializedName("NotifyUserIDs") + private List notifyUserIDs; + + /** 通知组id集合 */ + @SerializedName("NotifyGroupIDs") + private List notifyGroupIDs; + + /** 通知渠道('email', 'sms', 'webhook') */ + @SerializedName("NotifyChannelDs") + private List notifyChannelDs; + + /** 回调语言(cn,en) */ + @SerializedName("CallbackLanguage") + private String callbackLanguage; + + /** 回调地址 */ + @SerializedName("CallbackUrls") + private List callbackUrls; + + /** 告警策略状态 */ + @SerializedName("Status") + private Integer status; + + /** 告警策略备注 */ + @SerializedName("Remark") + private String remark; + + /** 创建人 */ + @SerializedName("CreatedBy") + private String createdBy; + + /** 更新人 */ + @SerializedName("UpdatedBy") + private String updatedBy; + + /** 创建时间 */ + @SerializedName("CreatedAt") + private Integer createdAt; + + /** 更新时间 */ + @SerializedName("UpdatedAt") + private Integer updatedAt; + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getProductType() { + return productType; + } + + public void setProductType(Integer productType) { + this.productType = productType; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getConfigMode() { + return configMode; + } + + public void setConfigMode(Integer configMode) { + this.configMode = configMode; + } + + public Integer getTemplateId() { + return templateId; + } + + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + public String getNotifyType() { + return notifyType; + } + + public void setNotifyType(String notifyType) { + this.notifyType = notifyType; + } + + public List getNotifyUserIDs() { + return notifyUserIDs; + } + + public void setNotifyUserIDs(List notifyUserIDs) { + this.notifyUserIDs = notifyUserIDs; + } + + public List getNotifyGroupIDs() { + return notifyGroupIDs; + } + + public void setNotifyGroupIDs(List notifyGroupIDs) { + this.notifyGroupIDs = notifyGroupIDs; + } + + public List getNotifyChannelDs() { + return notifyChannelDs; + } + + public void setNotifyChannelDs(List notifyChannelDs) { + this.notifyChannelDs = notifyChannelDs; + } + + public String getCallbackLanguage() { + return callbackLanguage; + } + + public void setCallbackLanguage(String callbackLanguage) { + this.callbackLanguage = callbackLanguage; + } + + public List getCallbackUrls() { + return callbackUrls; + } + + public void setCallbackUrls(List callbackUrls) { + this.callbackUrls = callbackUrls; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public Integer getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + public Integer getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateRequest.java new file mode 100644 index 00000000..3235b2b4 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateRequest.java @@ -0,0 +1,87 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListAlertStrategyTemplateRequest extends Request { + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考GetProjectList接口 */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** */ + @UCloudParam("Filter") + private Filter filter; + + /** 查询返回数量,默认值300,最大值:300。 */ + @UCloudParam("Limit") + private Integer limit; + + /** 数据偏移量 (默认0) */ + @UCloudParam("Offset") + private Integer offset; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public static class Filter extends Request { + + /** 模板id集合,根据模板id获取告警条件模板列表 */ + @UCloudParam("TemplateIDs") + private List templateIDs; + + public List getTemplateIDs() { + return templateIDs; + } + + public void setTemplateIDs(List templateIDs) { + this.templateIDs = templateIDs; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateResponse.java new file mode 100644 index 00000000..d94e1c8e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListAlertStrategyTemplateResponse.java @@ -0,0 +1,281 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListAlertStrategyTemplateResponse extends Response { + + /** 条件模板列表 */ + @SerializedName("Data") + private List data; + + /** 条件模板总条数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public static class AlertRule extends Response { + + /** 规则ID */ + @SerializedName("RuleID") + private Integer ruleID; + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @SerializedName("MetricID") + private Integer metricID; + + /** 指标名称 */ + @SerializedName("MetricName") + private String metricName; + + /** 阈值比较方式 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @SerializedName("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @SerializedName("ThresholdValue") + private Double thresholdValue; + + /** 触发次数 */ + @SerializedName("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @SerializedName("SendPeriodType") + private String sendPeriodType; + + /** 发送间隔 */ + @SerializedName("SendInterval") + private Integer sendInterval; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @SerializedName("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @SerializedName("Status") + private Integer status; + + /** 单位id */ + @SerializedName("UnitID") + private Integer unitID; + + /** 单位名称 */ + @SerializedName("UnitName") + private String unitName; + + public Integer getRuleID() { + return ruleID; + } + + public void setRuleID(Integer ruleID) { + this.ruleID = ruleID; + } + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + this.metricName = metricName; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Double getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Double thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getUnitID() { + return unitID; + } + + public void setUnitID(Integer unitID) { + this.unitID = unitID; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + } + + public static class ListAlertTemplate extends Response { + + /** 公司id */ + @SerializedName("CompanyID") + private Integer companyID; + + /** 模板Id */ + @SerializedName("TemplateID") + private Integer templateID; + + /** 告警模板名称 */ + @SerializedName("Name") + private String name; + + /** 产品类型(数值型)。参考ListMonitorProduct获取监控对象类型列表 */ + @SerializedName("ProductType") + private Integer productType; + + /** 产品类型(字符型)。参考ListMonitorProduct获取监控对象类型列表 */ + @SerializedName("ProductKey") + private String productKey; + + /** 告警条件规则 */ + @SerializedName("RuleSet") + private List ruleSet; + + /** 条件模板备注 */ + @SerializedName("Remark") + private String remark; + + public Integer getCompanyID() { + return companyID; + } + + public void setCompanyID(Integer companyID) { + this.companyID = companyID; + } + + public Integer getTemplateID() { + return templateID; + } + + public void setTemplateID(Integer templateID) { + this.templateID = templateID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getProductType() { + return productType; + } + + public void setProductType(Integer productType) { + this.productType = productType; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductRequest.java new file mode 100644 index 00000000..29c796e3 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductRequest.java @@ -0,0 +1,19 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.request.Request; + +public class ListMonitorProductRequest extends Request {} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductResponse.java new file mode 100644 index 00000000..d4cff16d --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ListMonitorProductResponse.java @@ -0,0 +1,185 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListMonitorProductResponse extends Response { + + /** 返回数据 */ + @SerializedName("Data") + private ListMonitorProduct data; + + /** 链路ID */ + @SerializedName("TraceId") + private String traceId; + + public ListMonitorProduct getData() { + return data; + } + + public void setData(ListMonitorProduct data) { + this.data = data; + } + + public String getTraceId() { + return traceId; + } + + public void setTraceId(String traceId) { + this.traceId = traceId; + } + + public static class ListMonitorProduct extends Response { + + /** 查询结果总数 */ + @SerializedName("Total") + private Integer total; + + /** 查询结果列表 */ + @SerializedName("List") + private List list; + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + + public static class Product extends Response { + + /** ID */ + @SerializedName("Id") + private Integer id; + + /** 资源类型ID */ + @SerializedName("ProductType") + private Integer productType; + + /** 资源类型唯一key */ + @SerializedName("ProductKey") + private String productKey; + + /** 产品名称 */ + @SerializedName("ProductName") + private String productName; + + /** 产品子名称 */ + @SerializedName("ProductName1") + private String productName1; + + /** 产品中文名称 */ + @SerializedName("ProductChName") + private String productChName; + + /** 产品英文名称 */ + @SerializedName("ProductEnName") + private String productEnName; + + /** {Type: 1|2, Key:string, Name: string}[] -> JSON字符串 */ + @SerializedName("Metas") + private String metas; + + /** 产品分组 */ + @SerializedName("ProductGroup") + private String productGroup; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getProductType() { + return productType; + } + + public void setProductType(Integer productType) { + this.productType = productType; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductName1() { + return productName1; + } + + public void setProductName1(String productName1) { + this.productName1 = productName1; + } + + public String getProductChName() { + return productChName; + } + + public void setProductChName(String productChName) { + this.productChName = productChName; + } + + public String getProductEnName() { + return productEnName; + } + + public void setProductEnName(String productEnName) { + this.productEnName = productEnName; + } + + public String getMetas() { + return metas; + } + + public void setMetas(String metas) { + this.metas = metas; + } + + public String getProductGroup() { + return productGroup; + } + + public void setProductGroup(String productGroup) { + this.productGroup = productGroup; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkRequest.java new file mode 100644 index 00000000..e13b444e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkRequest.java @@ -0,0 +1,76 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class ModifyAlertStrategyRemarkRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 策略id */ + @NotEmpty + @UCloudParam("AlertStrategyID") + private Integer alertStrategyID; + + /** 策略名称 */ + @NotEmpty + @UCloudParam("Name") + private String name; + + /** 策略备注 */ + @UCloudParam("Remark") + private String remark; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkResponse.java new file mode 100644 index 00000000..38a96f7a --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/ModifyAlertStrategyRemarkResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class ModifyAlertStrategyRemarkResponse extends Response { + + /** 返回数据 */ + @SerializedName("Data") + private AlertStrategyId data; + + public AlertStrategyId getData() { + return data; + } + + public void setData(AlertStrategyId data) { + this.data = data; + } + + public static class AlertStrategyId extends Response { + + /** 告警策略id */ + @SerializedName("AlertStrategyID") + private Integer alertStrategyID; + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetRequest.java new file mode 100644 index 00000000..84c987eb --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetRequest.java @@ -0,0 +1,197 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class QueryMetricDataSetRequest extends Request { + + /** 地域。 全局产品可不传,其他类型必传。 */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。 */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 资源类型 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** 开始时间 */ + @NotEmpty + @UCloudParam("StartTime") + private Integer startTime; + + /** 截止时间 */ + @NotEmpty + @UCloudParam("EndTime") + private Integer endTime; + + /** 计算方式,枚举值如下: raw:原始值, max:最大值, min:最小值, avg:平均值, sum:求和 */ + @NotEmpty + @UCloudParam("CalcMethod") + private String calcMethod; + + /** + * 周期即:数据查询时,后端上报数据点的频率,选择不同的自定义时间范围,对应的周期不同: 0<时间范围<=1h——周期:1分钟/5分钟 1h<时间范围<=3h——周期:1分钟/5分钟/1小时 + * 3h<时间范围<=24h——周期:5分钟/1小时 1天<时间范围<=30天——周期:1小时/6小时/24小时 需将周期转化为单位为秒的数值,传入参数 + */ + @NotEmpty + @UCloudParam("Period") + private Integer period; + + /** */ + @UCloudParam("MetricInfos") + private List metricInfos; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getStartTime() { + return startTime; + } + + public void setStartTime(Integer startTime) { + this.startTime = startTime; + } + + public Integer getEndTime() { + return endTime; + } + + public void setEndTime(Integer endTime) { + this.endTime = endTime; + } + + public String getCalcMethod() { + return calcMethod; + } + + public void setCalcMethod(String calcMethod) { + this.calcMethod = calcMethod; + } + + public Integer getPeriod() { + return period; + } + + public void setPeriod(Integer period) { + this.period = period; + } + + public List getMetricInfos() { + return metricInfos; + } + + public void setMetricInfos(List metricInfos) { + this.metricInfos = metricInfos; + } + + public static class MetricInfos extends Request { + + /** 指标名 */ + @NotEmpty + @UCloudParam("Metric") + private String metric; + + /** 指标所属资源id */ + @NotEmpty + @UCloudParam("ResourceId") + private String resourceId; + + /** */ + @UCloudParam("TagList") + private List tagList; + + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public List getTagList() { + return tagList; + } + + public void setTagList(List tagList) { + this.tagList = tagList; + } + } + + public static class MetricInfosTagList extends Request { + + /** 要查询指标的Tag的key */ + @UCloudParam("TagKey") + private String tagKey; + + /** 要查询指标的Tag的Value */ + @UCloudParam("TagValues") + private List tagValues; + + public String getTagKey() { + return tagKey; + } + + public void setTagKey(String tagKey) { + this.tagKey = tagKey; + } + + public List getTagValues() { + return tagValues; + } + + public void setTagValues(List tagValues) { + this.tagValues = tagValues; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetResponse.java new file mode 100644 index 00000000..0ce5d220 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSetResponse.java @@ -0,0 +1,171 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class QueryMetricDataSetResponse extends Response { + + /** 日志链路id */ + @SerializedName("TraceId") + private String traceId; + + /** QueryMetricDataResp */ + @SerializedName("Data") + private QueryMetricDataResp data; + + public String getTraceId() { + return traceId; + } + + public void setTraceId(String traceId) { + this.traceId = traceId; + } + + public QueryMetricDataResp getData() { + return data; + } + + public void setData(QueryMetricDataResp data) { + this.data = data; + } + + public static class MetricResult extends Response { + + /** 资源的短id */ + @SerializedName("ResourceId") + private String resourceId; + + /** TagMap是一个对象,key和value均为字符串。 TagMap返回当前series的所有的tag的key和value。 */ + @SerializedName("TagMap") + private Object tagMap; + + /** */ + @SerializedName("Values") + private List values; + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public Object getTagMap() { + return tagMap; + } + + public void setTagMap(Object tagMap) { + this.tagMap = tagMap; + } + + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + } + + public static class MetricSample extends Response { + + /** 时间戳 */ + @SerializedName("Timestamp") + private Integer timestamp; + + /** 样本值 */ + @SerializedName("Value") + private Double value; + + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + } + + public static class QueryMetricDataResp extends Response { + + /** 查询的结果集 */ + @SerializedName("List") + private List list; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + + public static class QueryMetricDataRespItem extends Response { + + /** 指标名 */ + @SerializedName("Metric") + private String metric; + + /** + * 指标查询结果的所有tag的key和对应的所有value数组。 + * + *

Tags格式为,key为tagkey字符串,value为tagValue的字符串数组。 + */ + @SerializedName("Tags") + private Object tags; + + /** */ + @SerializedName("Results") + private List results; + + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public Object getTags() { + return tags; + } + + public void setTags(Object tags) { + this.tags = tags; + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryRequest.java new file mode 100644 index 00000000..e4e020fb --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryRequest.java @@ -0,0 +1,112 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class QueryMetricDataSummaryRequest extends Request { + + /** 地域,全局产品可以不传,其他必传 */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。 */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 产品类型 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** 跳过的数量 */ + @NotEmpty + @UCloudParam("Offset") + private Integer offset; + + /** 当前页数据尺寸 */ + @NotEmpty + @UCloudParam("Limit") + private Integer limit; + + /** 指定要查询的指标列表,不指定则使用默认的指标集合 */ + @UCloudParam("Metrics") + private List metrics; + + /** 指定要查询的资源ID列表 */ + @UCloudParam("ResourceIds") + private List resourceIds; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public List getMetrics() { + return metrics; + } + + public void setMetrics(List metrics) { + this.metrics = metrics; + } + + public List getResourceIds() { + return resourceIds; + } + + public void setResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryResponse.java new file mode 100644 index 00000000..14fee6a4 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/QueryMetricDataSummaryResponse.java @@ -0,0 +1,326 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class QueryMetricDataSummaryResponse extends Response { + + /** 链路id */ + @SerializedName("TraceId") + private String traceId; + + /** 总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 数据 */ + @SerializedName("Data") + private QueryMetricDataSummaryRespData data; + + public String getTraceId() { + return traceId; + } + + public void setTraceId(String traceId) { + this.traceId = traceId; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public QueryMetricDataSummaryRespData getData() { + return data; + } + + public void setData(QueryMetricDataSummaryRespData data) { + this.data = data; + } + + public static class MetricSample extends Response { + + /** 时间戳 */ + @SerializedName("Timestamp") + private Integer timestamp; + + /** 样本值 */ + @SerializedName("Value") + private Double value; + + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + } + + public static class MetricSingleSample extends Response { + + /** 指标名 */ + @SerializedName("Metric") + private String metric; + + /** 指标的tag的k-v对象 */ + @SerializedName("Tags") + private Object tags; + + /** 指标单个样本点对象 */ + @SerializedName("Value") + private MetricSample value; + + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public Object getTags() { + return tags; + } + + public void setTags(Object tags) { + this.tags = tags; + } + + public MetricSample getValue() { + return value; + } + + public void setValue(MetricSample value) { + this.value = value; + } + } + + public static class QueryMetricDataSummaryRespData extends Response { + + /** 总数 */ + @SerializedName("Total") + private Integer total; + + /** 结果集 */ + @SerializedName("List") + private List list; + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + } + + public static class ResourceMonitorItem extends Response { + + /** 指标名 */ + @SerializedName("Metric") + private String metric; + + /** 指标数据数组 */ + @SerializedName("MetricValues") + private List metricValues; + + public String getMetric() { + return metric; + } + + public void setMetric(String metric) { + this.metric = metric; + } + + public List getMetricValues() { + return metricValues; + } + + public void setMetricValues(List metricValues) { + this.metricValues = metricValues; + } + } + + public static class ResourceSummary extends Response { + + /** 地域 */ + @SerializedName("Region") + private String region; + + /** 可用区 */ + @SerializedName("Zone") + private String zone; + + /** 项目id */ + @SerializedName("ProjectId") + private Integer projectId; + + /** 公司id */ + @SerializedName("CompanyId") + private Integer companyId; + + /** 资源id */ + @SerializedName("ResourceId") + private String resourceId; + + /** 资源名称 */ + @SerializedName("Name") + private String name; + + /** 地域中文名 */ + @SerializedName("RegionCN") + private String regionCN; + + /** 可用区中文 */ + @SerializedName("ZoneCN") + private String zoneCN; + + /** 产品类型 */ + @SerializedName("ProductKey") + private String productKey; + + /** 项目id */ + @SerializedName("OrganizationId") + private Integer organizationId; + + /** 资源状态 */ + @SerializedName("Status") + private Integer status; + + /** 资源的各项指标当前值,类型为: map[string][]MetricSingleSample map的key为指标名,value为样本点数组。 */ + @SerializedName("MonitorAttr") + private List monitorAttr; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public Integer getProjectId() { + return projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public Integer getCompanyId() { + return companyId; + } + + public void setCompanyId(Integer companyId) { + this.companyId = companyId; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRegionCN() { + return regionCN; + } + + public void setRegionCN(String regionCN) { + this.regionCN = regionCN; + } + + public String getZoneCN() { + return zoneCN; + } + + public void setZoneCN(String zoneCN) { + this.zoneCN = zoneCN; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getOrganizationId() { + return organizationId; + } + + public void setOrganizationId(Integer organizationId) { + this.organizationId = organizationId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public List getMonitorAttr() { + return monitorAttr; + } + + public void setMonitorAttr(List monitorAttr) { + this.monitorAttr = monitorAttr; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyRequest.java new file mode 100644 index 00000000..b9368980 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UnBindAlertStrategyRequest extends Request { + + /** 项目ID */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警策略数组 */ + @NotEmpty + @UCloudParam("AlertStrategyIDs") + private List alertStrategyIDs; + + /** 资源数组 */ + @NotEmpty + @UCloudParam("Resources") + private List resources; + + /** 产品类型名称 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getAlertStrategyIDs() { + return alertStrategyIDs; + } + + public void setAlertStrategyIDs(List alertStrategyIDs) { + this.alertStrategyIDs = alertStrategyIDs; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyResponse.java new file mode 100644 index 00000000..feee41c0 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UnBindAlertStrategyResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + + +import cn.ucloud.common.response.Response; + +public class UnBindAlertStrategyResponse extends Response {} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyRequest.java new file mode 100644 index 00000000..7d154848 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyRequest.java @@ -0,0 +1,323 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UpdateAlertStrategyRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 告警策略id */ + @NotEmpty + @UCloudParam("AlertStrategyID") + private String alertStrategyID; + + /** 告警策略名称。最大长度255个字符 */ + @NotEmpty + @UCloudParam("Name") + private String name; + + /** 产品类型。参考ListMonitorProduct获取监控对象类型列表 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** 绑定资源类型 1 资源组 2 资源 */ + @NotEmpty + @UCloudParam("ObjectType") + private Integer objectType; + + /** 条件设置方式 1. 手动配置 2.选择模版 */ + @NotEmpty + @UCloudParam("ConfigMode") + private Integer configMode; + + /** 绑定资源,对应绑定资源类型ObjectType=2 */ + @UCloudParam("Resources") + private List resources; + + /** 绑定资源组,对应绑定资源类型ObjectType=1 */ + @UCloudParam("ResourceGroupIDs") + private List resourceGroupIDs; + + /** 模板id.对应ConfigMode=2 */ + @UCloudParam("TemplateId") + private Integer templateId; + + /** */ + @UCloudParam("RuleSet") + private List ruleSet; + + /** 通知类型 通知组 group 通知人 user */ + @UCloudParam("NotifyType") + private String notifyType; + + /** 通知人id */ + @UCloudParam("NotifyUserIDs") + private List notifyUserIDs; + + /** 通知人组id */ + @UCloudParam("NotifyGroupIDs") + private List notifyGroupIDs; + + /** 通知渠道 短信sms 邮件email 回调webhook */ + @UCloudParam("NotifyChannelDs") + private List notifyChannelDs; + + /** 通知渠道回调webhook 回调语言 中文cn 英文en */ + @UCloudParam("CallbackLanguage") + private String callbackLanguage; + + /** 回调url */ + @UCloudParam("CallbackUrls") + private List callbackUrls; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(String alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public Integer getObjectType() { + return objectType; + } + + public void setObjectType(Integer objectType) { + this.objectType = objectType; + } + + public Integer getConfigMode() { + return configMode; + } + + public void setConfigMode(Integer configMode) { + this.configMode = configMode; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public List getResourceGroupIDs() { + return resourceGroupIDs; + } + + public void setResourceGroupIDs(List resourceGroupIDs) { + this.resourceGroupIDs = resourceGroupIDs; + } + + public Integer getTemplateId() { + return templateId; + } + + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public String getNotifyType() { + return notifyType; + } + + public void setNotifyType(String notifyType) { + this.notifyType = notifyType; + } + + public List getNotifyUserIDs() { + return notifyUserIDs; + } + + public void setNotifyUserIDs(List notifyUserIDs) { + this.notifyUserIDs = notifyUserIDs; + } + + public List getNotifyGroupIDs() { + return notifyGroupIDs; + } + + public void setNotifyGroupIDs(List notifyGroupIDs) { + this.notifyGroupIDs = notifyGroupIDs; + } + + public List getNotifyChannelDs() { + return notifyChannelDs; + } + + public void setNotifyChannelDs(List notifyChannelDs) { + this.notifyChannelDs = notifyChannelDs; + } + + public String getCallbackLanguage() { + return callbackLanguage; + } + + public void setCallbackLanguage(String callbackLanguage) { + this.callbackLanguage = callbackLanguage; + } + + public List getCallbackUrls() { + return callbackUrls; + } + + public void setCallbackUrls(List callbackUrls) { + this.callbackUrls = callbackUrls; + } + + public static class RuleSet extends Request { + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @UCloudParam("MetricID") + private Integer metricID; + + /** 阈值比较方式。 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @UCloudParam("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @UCloudParam("ThresholdValue") + private Integer thresholdValue; + + /** 触发次数 */ + @UCloudParam("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @UCloudParam("SendPeriodType") + private String sendPeriodType; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @UCloudParam("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @UCloudParam("Status") + private Integer status; + + /** 沉默周期(告警周期选择为连续时必填) */ + @UCloudParam("SendInterval") + private Integer sendInterval; + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Integer getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Integer thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyResponse.java new file mode 100644 index 00000000..f92a5fee --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class UpdateAlertStrategyResponse extends Response { + + /** 更新告警策略返回对象 */ + @SerializedName("Data") + private AlertStrategyId data; + + public AlertStrategyId getData() { + return data; + } + + public void setData(AlertStrategyId data) { + this.data = data; + } + + public static class AlertStrategyId extends Response { + + /** 告警策略id */ + @SerializedName("AlertStrategyID") + private Integer alertStrategyID; + + public Integer getAlertStrategyID() { + return alertStrategyID; + } + + public void setAlertStrategyID(Integer alertStrategyID) { + this.alertStrategyID = alertStrategyID; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateRequest.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateRequest.java new file mode 100644 index 00000000..816a4c2e --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateRequest.java @@ -0,0 +1,208 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UpdateAlertStrategyTemplateRequest extends Request { + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 条件模板ID */ + @NotEmpty + @UCloudParam("TemplateID") + private Integer templateID; + + /** 告警模板名称。最大长度64个字符 */ + @NotEmpty + @UCloudParam("Name") + private String name; + + /** 产品类型。参考ListMonitorProduct获取监控对象类型列表 */ + @NotEmpty + @UCloudParam("ProductKey") + private String productKey; + + /** */ + @UCloudParam("RuleSet") + private List ruleSet; + + /** 备注 */ + @UCloudParam("Remark") + private String remark; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Integer getTemplateID() { + return templateID; + } + + public void setTemplateID(Integer templateID) { + this.templateID = templateID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + public List getRuleSet() { + return ruleSet; + } + + public void setRuleSet(List ruleSet) { + this.ruleSet = ruleSet; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public static class RuleSet extends Request { + + /** 规则指标ID。参考该类型产品下返回的指标列表GetProductMetrics */ + @NotEmpty + @UCloudParam("MetricID") + private Integer metricID; + + /** 阈值比较方式。 枚举值比较方式: 1->= 2-<= 3-> 4-< 5-== 6-!= */ + @NotEmpty + @UCloudParam("ThresholdCompare") + private Integer thresholdCompare; + + /** 触发阈值 */ + @NotEmpty + @UCloudParam("ThresholdValue") + private Integer thresholdValue; + + /** 触发次数 */ + @NotEmpty + @UCloudParam("TriggerCount") + private Integer triggerCount; + + /** 触发周期。枚举值:continuous连续 exponent 指数 single 不重复 */ + @NotEmpty + @UCloudParam("SendPeriodType") + private String sendPeriodType; + + /** 告警等级。枚举值:P0,P1,P2,P3 */ + @NotEmpty + @UCloudParam("Level") + private String level; + + /** 告警状态。枚举值:0-关闭 1-开启 */ + @NotEmpty + @UCloudParam("Status") + private Integer status; + + /** 沉默周期(告警周期选择为连续时必填) */ + @UCloudParam("SendInterval") + private Integer sendInterval; + + public Integer getMetricID() { + return metricID; + } + + public void setMetricID(Integer metricID) { + this.metricID = metricID; + } + + public Integer getThresholdCompare() { + return thresholdCompare; + } + + public void setThresholdCompare(Integer thresholdCompare) { + this.thresholdCompare = thresholdCompare; + } + + public Integer getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(Integer thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public Integer getTriggerCount() { + return triggerCount; + } + + public void setTriggerCount(Integer triggerCount) { + this.triggerCount = triggerCount; + } + + public String getSendPeriodType() { + return sendPeriodType; + } + + public void setSendPeriodType(String sendPeriodType) { + this.sendPeriodType = sendPeriodType; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + } +} diff --git a/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateResponse.java b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateResponse.java new file mode 100644 index 00000000..5426f550 --- /dev/null +++ b/ucloud-sdk-java-cloudwatch/src/main/java/cn/ucloud/cloudwatch/models/UpdateAlertStrategyTemplateResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cloudwatch.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class UpdateAlertStrategyTemplateResponse extends Response { + + /** 更新条件模板ID */ + @SerializedName("Data") + private AlertTemplate data; + + public AlertTemplate getData() { + return data; + } + + public void setData(AlertTemplate data) { + this.data = data; + } + + public static class AlertTemplate extends Response { + + /** 告警模板ID */ + @SerializedName("TemplateID") + private Integer templateID; + + public Integer getTemplateID() { + return templateID; + } + + public void setTemplateID(Integer templateID) { + this.templateID = templateID; + } + } +} diff --git a/ucloud-sdk-java-common/pom.xml b/ucloud-sdk-java-common/pom.xml old mode 100755 new mode 100644 index 5d386c2d..1aaf4f8b --- a/ucloud-sdk-java-common/pom.xml +++ b/ucloud-sdk-java-common/pom.xml @@ -1,24 +1,21 @@ - - + + ucloud-sdk-java cn.ucloud - 0.8.4.4-release + 1.2.51-release 4.0.0 ucloud-sdk-java-common - 0.8.4.4-release + ucloud-sdk-java + 1.2.51-release - - - org.hibernate - hibernate-validator - - org.glassfish javax.el @@ -66,6 +63,14 @@ jsonassert test + + + + org.mockito + mockito-all + 1.10.19 + test + - \ No newline at end of file + diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/NotEmpty.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/NotEmpty.java new file mode 100644 index 00000000..eee8a11a --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/NotEmpty.java @@ -0,0 +1,24 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** Annotation to mark the field is required */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface NotEmpty {} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UCloudParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UCloudParam.java new file mode 100644 index 00000000..6064ad8b --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UCloudParam.java @@ -0,0 +1,26 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** Annotation of UCloud parameters */ +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface UCloudParam { + String value(); // parameter name +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudMethod.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudMethod.java deleted file mode 100644 index d3d00091..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudMethod.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.ucloud.common.annotation; - - -import cn.ucloud.common.http.HttpContentType; -import cn.ucloud.common.http.HttpMethod; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 17:45 - **/ - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface UcloudMethod { - HttpMethod method() default HttpMethod.GET; - HttpContentType contentType() default HttpContentType.APPLICATION_URL_ENCODED; -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudParam.java deleted file mode 100755 index c9ad18dd..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudParam.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.ucloud.common.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @description: 属性和参数映射注解 - * @author: codezhang - * @date: 2018-09-13 13:28 - **/ - - -@Target({ElementType.FIELD,ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface UcloudParam { - String value(); -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudRestParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudRestParam.java deleted file mode 100644 index 9fde39d6..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/annotation/UcloudRestParam.java +++ /dev/null @@ -1,24 +0,0 @@ -package cn.ucloud.common.annotation; - -import cn.ucloud.common.http.ParamLocation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 17:45 - **/ - -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface UcloudRestParam { - String name(); - - ParamLocation location() default ParamLocation.URL; - - boolean signature() default false; -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/Client.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/Client.java new file mode 100644 index 00000000..7efd9a89 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/Client.java @@ -0,0 +1,31 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.client; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import java.io.Closeable; + +public interface Client extends Closeable { + /** + * invoke api from request and response + * + * @param request request object + * @param clazz response class + * @return response object + */ + Response invoke(Request request, Class clazz) throws UCloudException; +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultClient.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultClient.java new file mode 100644 index 00000000..538efa4b --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultClient.java @@ -0,0 +1,144 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.client; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.RetCodeException; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.middleware.Context; +import cn.ucloud.common.middleware.Middleware; +import cn.ucloud.common.middlewares.CredentialMiddleware; +import cn.ucloud.common.middlewares.LogMiddleware; +import cn.ucloud.common.middlewares.ValidationMiddleware; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; +import cn.ucloud.common.transport.DefaultTransport; +import cn.ucloud.common.transport.Transport; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class DefaultClient implements Client { + private Transport transport; + + private Config config; + + private Credential credential; + + private final List middlewares; + + public DefaultClient(Config config, Credential credential) { + this.setConfig(config); + this.setCredential(credential); + this.setTransport( + new DefaultTransport( + this.getConfig().getBaseUrl(), this.getConfig().getUserAgent())); + this.middlewares = new ArrayList<>(); + this.useMiddleware(new ValidationMiddleware()); + this.useMiddleware(new CredentialMiddleware()); + this.useMiddleware(new LogMiddleware()); + } + + @Override + public Response invoke(Request request, Class clazz) + throws UCloudException { + Context ctx = new Context(); + ctx.setConfig(this.getConfig()); + ctx.setCredential(this.getCredential()); + + // resolve request + ctx.setRequest(request); + for (Middleware middleware : this.middlewares) { + ctx.setRequest(middleware.handleRequest(ctx)); + } + + // do invoking + Response response = null; + try { + response = call(ctx, request, clazz); + } catch (UCloudException e) { + ctx.setException(e); + for (Middleware middleware : this.middlewares) { + middleware.handleException(ctx); + } + throw e; + } + + // resolve response + ctx.setResponse(response); + for (Middleware middleware : this.middlewares) { + ctx.setResponse(middleware.handleResponse(ctx)); + } + return ctx.getResponse(); + } + + private Response call(Context ctx, Request request, Class clazz) + throws UCloudException { + Response response = null; + Integer maxRetries = request.loadMaxRetries(); + for (int i = 0; i <= maxRetries; i++) { + // TODO: use backoff retry + try { + response = this.transport.invoke(ctx.getRequest(), clazz); + break; + } catch (UCloudException e) { + if (i == maxRetries) { + throw e; + } + } + } + + // check if return code is not zero, mark it as ucloud server exception + if (response != null && response.getRetCode() != 0) { + throw new RetCodeException( + response.getRetCode(), response.getMessage(), response.getRequestId()); + } + return response; + } + + public void useMiddleware(Middleware middleware) { + this.middlewares.add(middleware); + } + + public void setTransport(Transport transport) { + this.transport = transport; + } + + public Transport getTransport() { + return transport; + } + + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public Credential getCredential() { + return credential; + } + + public void setCredential(Credential credential) { + this.credential = credential; + } + + @Override + public void close() throws IOException { + this.transport.close(); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultUcloudClient.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultUcloudClient.java deleted file mode 100755 index 7a47ec37..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/DefaultUcloudClient.java +++ /dev/null @@ -1,75 +0,0 @@ -package cn.ucloud.common.client; - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.http.UcloudHttp; -import cn.ucloud.common.http.UcloudHttpImpl; -import cn.ucloud.common.model.GetProjectListParam; -import cn.ucloud.common.model.GetProjectListResult; -import cn.ucloud.common.model.GetRegionParam; -import cn.ucloud.common.model.GetRegionResult; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.BaseResponseResult; -import cn.ucloud.common.pojo.UcloudConfig; - -/** - * @description: 默认的ucloud基础服务client - * @author: codezhang - * @date: 2018-11-13 13:52 - **/ - -public class DefaultUcloudClient implements UcloudClient { - protected UcloudConfig config; - - public DefaultUcloudClient(UcloudConfig config) { - this.config = config; - } - - @Override - public GetRegionResult getRegion() throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetRegionResult.class); - return (GetRegionResult) http.doPost(new GetRegionParam(), config, null); - } - - @Override - public void getRegion(UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetRegionResult.class); - try { - http.doPost(new GetRegionParam(), config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetProjectListResult getProjectList() throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetProjectListResult.class); - return (GetProjectListResult) http.doPost(new GetProjectListParam(), config, null); - } - - @Override - public void getProjectList(UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetProjectListResult.class); - try { - http.doPost(new GetProjectListParam(), config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public BaseResponseResult doAction(BaseRequestParam param, - Class clazz) throws Exception { - UcloudHttp http = new UcloudHttpImpl(clazz); - return (BaseResponseResult) http.doPost(param, config, null); - } - - @Override - public void doAction(BaseRequestParam param, Class clazz, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(clazz); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/UcloudClient.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/UcloudClient.java deleted file mode 100755 index 168cec40..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/client/UcloudClient.java +++ /dev/null @@ -1,77 +0,0 @@ -package cn.ucloud.common.client; - - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.model.GetProjectListResult; -import cn.ucloud.common.model.GetRegionResult; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @description: ucloud基础服务client - * @author: codezhang - * @date: 2018-09-13 11:01 - **/ - -public interface UcloudClient { - - /** - * 获取地域信息-GetRegion - * - * @return {@link GetRegionResult} 结果对象 - * @throws Exception 出错抛出异常 - */ - GetRegionResult getRegion() throws Exception; - - /** - * 获取地域信息-GetRegion (回调) - * - * @param handler {@link UcloudHandler}回调callback - * @param asyncFlag 是否异步 - */ - void getRegion(UcloudHandler handler, Boolean... asyncFlag); - - - /** - * 获取项目列表-GetProjectList - * - * @return {@link GetProjectListResult} 结果对象 - * @throws Exception 出错抛出异常 - */ - GetProjectListResult getProjectList() throws Exception; - - - /** - * 获取项目列表-GetProjectList (回调) - * - * @param handler {@link UcloudHandler}回调callback - * @param asyncFlag 是否异步 - */ - void getProjectList(UcloudHandler handler, Boolean... asyncFlag); - - - /** - * 适用于调用所有接口 - * - * @param param 请求参数 - * @param clazz 结果对象类 - * @return 结果对象 - * @throws Exception - */ - BaseResponseResult doAction(BaseRequestParam param, Class clazz) throws Exception; - - - /** - * 适用于调用所有接口,回调方式 - * - * @param param 请求参数 - * @param clazz 结果对象类 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void doAction(BaseRequestParam param, - Class clazz, - UcloudHandler handler, - Boolean... asyncFlag); - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/config/Config.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/config/Config.java new file mode 100644 index 00000000..3aac023b --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/config/Config.java @@ -0,0 +1,99 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Config { + + /** Region */ + private String region; + + /** Project id */ + private String projectId; + + /** Base url */ + private String baseUrl = "https://api.ucloud.cn"; + + /** User agent */ + private String userAgent; + + /** Timeout */ + private Integer timeout = 30; + + /** Max retries count */ + private Integer maxRetries = 0; + + /** Logger */ + private Logger logger = LoggerFactory.getLogger("cn.ucloud"); + + public Config() {} + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getBaseUrl() { + return baseUrl; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public Integer getMaxRetries() { + return maxRetries; + } + + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + public Logger getLogger() { + return logger; + } + + public void setLogger(Logger logger) { + this.logger = logger; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/credential/Credential.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/credential/Credential.java new file mode 100644 index 00000000..171eb392 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/credential/Credential.java @@ -0,0 +1,112 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.credential; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; + +import org.apache.commons.codec.digest.DigestUtils; + +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +import java.text.DecimalFormat; +import java.util.Arrays; +import java.util.Map; + +/** Credential is an object to represent the credential information */ +public class Credential { + + private String privateKey; + + private String publicKey; + + /** + * Credential constructor + * + * @param publicKey Public Key + * @param privateKey + */ + public Credential(String publicKey, String privateKey) { + this.privateKey = privateKey; + this.publicKey = publicKey; + } + + public String verifyAc(Request request) throws UCloudException { + Map params = request.encode(); + params.put("PublicKey", this.publicKey); + String[] keys = params.keySet().toArray(new String[0]); + Arrays.sort(keys); + + DecimalFormat df = new DecimalFormat("#"); + df.setMaximumFractionDigits(Integer.MAX_VALUE); + String s = ""; + for (String key : keys) { + s = s.concat(key); + Object value = params.get(key); + String valueStr; + if (value instanceof Double || value instanceof Float) { + // If the type is double or float, we need to trim the tailing zeros + // to be consistent with the json decoder. + valueStr = df.format(value); + } else { + valueStr = value.toString(); + } + s = s.concat(valueStr); + } + s = s.concat(this.privateKey); + + try { + return sha1(s); + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { + throw new UCloudException("sha1 error", e); + } + } + + public Request sign(Request request) throws UCloudException { + request.setPublicKey(this.publicKey); + request.setSignature(verifyAc(request)); + return request; + } + + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + private String sha1(String s) throws NoSuchAlgorithmException, UnsupportedEncodingException { + return formatBytes2HexString(DigestUtils.sha1(s)); + } + + public String formatBytes2HexString(byte[] data) { + if (data == null || data.length == 0) { + return ""; + } + StringBuilder sb = new StringBuilder(); + for (byte b : data) { + sb.append(String.format("%02x", b)); + } + return sb.toString(); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/HttpException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/HttpException.java deleted file mode 100755 index 1b60fb9a..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/HttpException.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.ucloud.common.exception; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-14 14:11 - **/ - -public class HttpException extends Exception{ - - - public HttpException(String message) { - super(message); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/InterfaceException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/InterfaceException.java deleted file mode 100755 index 008e478e..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/InterfaceException.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.ucloud.common.exception; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-19 17:20 - **/ - -public class InterfaceException extends Exception { - public InterfaceException(String message) { - super(message); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/RetCodeException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/RetCodeException.java new file mode 100644 index 00000000..c759d9d5 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/RetCodeException.java @@ -0,0 +1,41 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.exception; + +/** RetCodeException is the exception of a logic exception returned by remote service */ +public class RetCodeException extends UCloudException { + + private final Integer retCode; + + private final String requestId; + + /** + * @param retCode RetCode of response + * @param message Message to describe what happened + * @param requestId Request ID is the unique identifier of invoking lifycycle + */ + public RetCodeException(Integer retCode, String message, String requestId) { + super(String.format("[%s] %d: %s", requestId, retCode, message)); + this.retCode = retCode; + this.requestId = requestId; + } + + public Integer getRetCode() { + return retCode; + } + + public String getRequestId() { + return requestId; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/TransportException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/TransportException.java new file mode 100644 index 00000000..b17c81dd --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/TransportException.java @@ -0,0 +1,27 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.exception; + +public class TransportException extends UCloudException { + + /** + * Transport exception occurs when the transport has been invoking + * + * @param message Message of transport exception + * @param cause The origin exception caused by + */ + public TransportException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/UCloudException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/UCloudException.java new file mode 100644 index 00000000..3618dbb9 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/UCloudException.java @@ -0,0 +1,26 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.exception; + +/** UCloudException is the base-class of all the exception throw by SDK */ +public class UCloudException extends Exception { + + public UCloudException(String message) { + super(message); + } + + public UCloudException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/ValidatorException.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/ValidatorException.java old mode 100755 new mode 100644 index b64fe617..d21e23fb --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/ValidatorException.java +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/exception/ValidatorException.java @@ -1,13 +1,20 @@ -package cn.ucloud.common.exception; - /** - * @description: 自定义校验异常 - * @author: codezhang - * @date: 2018-09-13 11:43 - **/ - -public class ValidatorException extends Exception { + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.exception; +/** ValidatorException is the exception of parameters validator */ +public class ValidatorException extends UCloudException { public ValidatorException(String message) { super(message); } diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/handler/UcloudHandler.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/handler/UcloudHandler.java deleted file mode 100755 index 5fa20cbc..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/handler/UcloudHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.ucloud.common.handler; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-14 10:12 - **/ -public interface UcloudHandler { - /** - * 成功请求 处理函数 - * - * @param result 请求结果 - * @return 任意返回数据 - */ - Object success(R result); - - /** - * 失败请求 处理函数 - * - * @param result 请求结果 - * @return 任意返回数据 - */ - Object failed(R result); - - /** - * 请求发生错误 处理函数 - * - * @param e 异常 - * @return 任意返回数据 - */ - Object error(Exception e); -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/Http.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/Http.java deleted file mode 100644 index 7f20675c..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/Http.java +++ /dev/null @@ -1,157 +0,0 @@ -package cn.ucloud.common.http; - -import cn.ucloud.common.exception.HttpException; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.Gson; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 23:13 - **/ -public class Http { - - private Class resultClass; - - private boolean enableLog = false; - - public Http(Class resultClass) { - this.resultClass = resultClass; - } - - public Http(Class resultClass, boolean enableLog) { - this.resultClass = resultClass; - this.enableLog = enableLog; - } - - private static final Logger logger = LoggerFactory.getLogger(Http.class); - - private static final String SDK_VERSION = "0.8.4.4-release"; - - private static final String USER_AGENT; - - private static CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); - - static { - String runTimeVersion = System.getProperty("java.runtime.version"); - runTimeVersion = (runTimeVersion == null || runTimeVersion.isEmpty()) ? "UnKnown RuntimeVersion" : runTimeVersion; - - USER_AGENT = String.format("JAVA_%s/JAVA-SDK/%s", runTimeVersion, SDK_VERSION); - } - - public static void setHttpClient(CloseableHttpClient httpClient) { - if (httpClient != null) { - closeableHttpClient = httpClient; - } - } - - public BaseResponseResult doHttp(HttpUriRequest request, UcloudHandler handler, Boolean async) throws Exception { - CloseableHttpResponse response = null; - BaseResponseResult responseResult = null; - request.addHeader("User-Agent", USER_AGENT); - - if (enableLog && request instanceof HttpPost) { - String uriInfo = request.getURI().toString(); - String headerInfo = new Gson().toJson(request.getAllHeaders()); - String bodyInfo = EntityUtils.toString(((HttpPost) request).getEntity()); - logger.info("http POST request: \n" + - "\tURI:{}\n" + - "\tBody:{}\n" + - "\tHeaders:{}", - uriInfo, - bodyInfo, - headerInfo); - } else if (enableLog && request instanceof HttpGet) { - String uriInfo = request.getURI().toString(); - String headerInfo = new Gson().toJson(request.getAllHeaders()); - logger.info("http GET request: \n" + - "\tURI:{}\n" + - "\tHeaders:{}", - uriInfo, - headerInfo); - } - - try { - response = closeableHttpClient.execute(request); - if (response != null) { - // 正常响应 - String content = EntityUtils.toString(response.getEntity(), "UTF-8"); - if (enableLog) { - logger.info("response content:{}", content); - } - if (statusOK(response)) { - Gson gson = new Gson(); - responseResult = gson.fromJson(content, resultClass); - responseResult.setResponseContent(content); - if (handler != null) { - handlerResult(handler, responseResult); - } - } else { - // 非200则认为是个异常 - handlerException(handler, new HttpException(content), async); - } - } else { - handlerException(handler, new NullPointerException("response is null"), async); - } - } catch (Exception e) { - handlerException(handler, e, async); - } finally { - try { - if (response != null) { - response.close(); - } - } catch (IOException e) { - if (enableLog) { - logger.error("response close error:{}", e.getMessage()); - } - } - } - return responseResult; - } - - public static void closeHttpClient() throws IOException { - closeableHttpClient.close(); - } - - private void handlerResult(UcloudHandler handler, BaseResponseResult result) { - if (result.getRetCode() != 0) { - handler.failed(result); - } else { - handler.success(result); - } - } - - private boolean statusOK(CloseableHttpResponse response) { - boolean ok = false; - if (response != null) { - ok = response.getStatusLine().getStatusCode() == 200; - } - return ok; - } - - private void handlerException(UcloudHandler handler, Exception e, Boolean async) throws Exception { - if (handler == null) { - if (async != null) { - if (enableLog) { - logger.error("handler is null and async is not null,but get an error:{}", e.getMessage()); - } - } else { - throw e; - } - } else { - handler.error(e); - } - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpContentType.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpContentType.java deleted file mode 100644 index 15245d12..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpContentType.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.ucloud.common.http; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 19:37 - **/ -public enum HttpContentType { - APPLICATION_URL_ENCODED, MULTIPART_FORM_DATA, APPLICATION_JSON, APPLICATION_XML -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpMethod.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpMethod.java deleted file mode 100644 index 4420baa7..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/HttpMethod.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.ucloud.common.http; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 18:15 - **/ -public enum HttpMethod { - GET, POST, DELETE, PUT -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/ParamLocation.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/ParamLocation.java deleted file mode 100644 index 58f3508f..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/ParamLocation.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.ucloud.common.http; - -/** - * @Description : 参数位置 - * @Author : codezhang - * @Date : 2019-04-17 17:46 - **/ -public enum ParamLocation { - PATH, URL, BODY, HEADER -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttp.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttp.java deleted file mode 100755 index 6a0806d8..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttp.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.ucloud.common.http; - -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.UcloudConfig; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-14 11:39 - **/ - -public interface UcloudHttp { - /** - * http get 请求 - * - * @param param 请求参数对象 - * @param config 请求环境配置信息 - * @param handler 请求结果处理器 - * @param asyncFlag 异步标记位 默认true,请求处理器不为NULL时候有效 - * @return 同步时,返回请求到的数据结果 - * @throws Exception 同步非回调时,有异常则抛出异常 - */ - Object doGet(BaseRequestParam param, UcloudConfig config, UcloudHandler handler, Boolean... asyncFlag) throws Exception; - - - /** - * http post 请求 - * - * @param param 请求参数对象 - * @param config 请求环境配置信息 - * @param handler 请求结果处理器 - * @param asyncFlag 异步标记位 默认true,请求处理器不为NULL时候有效 - * @return 同步时,返回请求到的数据结果 - * @throws Exception 同步非回调时,有异常则抛出异常 - */ - Object doPost(BaseRequestParam param, UcloudConfig config, UcloudHandler handler, Boolean... asyncFlag) throws Exception; -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttpImpl.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttpImpl.java deleted file mode 100755 index 86daf105..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudHttpImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -package cn.ucloud.common.http; - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.BaseResponseResult; -import cn.ucloud.common.pojo.UcloudConfig; -import cn.ucloud.common.util.ParamConstructor; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.protocol.HTTP; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.charset.StandardCharsets; - -/** - * @description: UcloudHttp实现类 - * @author: codezhang - * @date: 2018-09-14 11:53 - **/ - -public class UcloudHttpImpl implements UcloudHttp { - - - private Class resultClass; - - public UcloudHttpImpl(Class resultClass) { - this.resultClass = resultClass; - } - - private static Logger logger = LoggerFactory.getLogger(UcloudHttpImpl.class.getName()); - - @Override - public Object doGet(BaseRequestParam param, - UcloudConfig config, - UcloudHandler handler, - Boolean... asyncFlag) throws Exception { - BaseResponseResult result = null; - try { - String httpGetParamString = ParamConstructor.getHttpGetParamString(param, config.getAccount()); - final HttpGet get = new HttpGet(config.getApiServerAddr() + "?" + httpGetParamString); - Http http = new Http(resultClass,config.isEnableLog()); - result = http.doHttp(get, handler, async(asyncFlag)); - } catch (Exception e) { - handlerException(handler, e, async(asyncFlag)); - } - return result; - } - - @Override - public Object doPost(BaseRequestParam param, UcloudConfig config, - UcloudHandler handler, Boolean... asyncFlag) throws Exception { - BaseResponseResult result = null; - try { - String httpPostParamString = ParamConstructor.getHttpPostParamString(param, config.getAccount()); - HttpPost post = new HttpPost(config.getApiServerAddr()); - //application/json - post.setHeader(HTTP.CONTENT_TYPE, "application/json"); - //post - StringEntity entity = new StringEntity(httpPostParamString, StandardCharsets.UTF_8); - entity.setContentType("application/json"); - post.setEntity(entity); - Http http = new Http(resultClass,config.isEnableLog()); - result = http.doHttp(post, handler, async(asyncFlag)); - } catch (Exception e) { - handlerException(handler, e, async(asyncFlag)); - } - return result; - } - - private void handlerException(UcloudHandler handler, Exception e, Boolean async) throws Exception { - if (handler == null) { - if (async != null) { - logger.error("handler is null and async is not null,but get an error:{}", e.getMessage()); - } else { - throw e; - } - } else { - handler.error(e); - } - } - - private Boolean async(Boolean... asyncFlag) { - Boolean async = null; - if (asyncFlag != null && asyncFlag.length > 0) { - async = asyncFlag[0]; - } - return async; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttp.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttp.java deleted file mode 100644 index 24621c03..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttp.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.common.http; - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.BaseRestRequestParam; -import cn.ucloud.common.pojo.UcloudConfig; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 17:08 - **/ -public interface UcloudRestHttp { - /** - * http get 请求 - * - * @param param 请求参数对象 - * @param config 请求环境配置信息 - * @param handler 请求结果处理器 - * @param restURL 请求地址 - * @param asyncFlag 异步标记位 默认true,请求处理器不为NULL时候有效 - * @return 同步时,返回请求到的数据结果 - * @throws Exception 同步非回调时,有异常则抛出异常 - */ - Object doGet(BaseRestRequestParam param, UcloudConfig config, String restURL, - UcloudHandler handler, Boolean... asyncFlag) throws Exception; - - - /** - * http post 请求 - * - * @param param 请求参数对象 - * @param config 请求环境配置信息 - * @param handler 请求结果处理器 - * @param restURL 请求地址 - * @param asyncFlag 异步标记位 默认true,请求处理器不为NULL时候有效 - * @return 同步时,返回请求到的数据结果 - * @throws Exception 同步非回调时,有异常则抛出异常 - */ - Object doPost(BaseRestRequestParam param, UcloudConfig config, String restURL, - UcloudHandler handler, Boolean... asyncFlag) throws Exception; -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttpImpl.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttpImpl.java deleted file mode 100644 index 77fb540c..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/http/UcloudRestHttpImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package cn.ucloud.common.http; - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.pojo.BaseResponseResult; -import cn.ucloud.common.pojo.BaseRestRequestParam; -import cn.ucloud.common.pojo.UcloudConfig; -import cn.ucloud.common.util.RestParamConstructor; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 17:41 - **/ -public class UcloudRestHttpImpl implements UcloudRestHttp { - - private Class resultClass; - - public UcloudRestHttpImpl(Class resultClass) { - this.resultClass = resultClass; - } - - private static Logger logger = LoggerFactory.getLogger(UcloudRestHttpImpl.class.getName()); - - @Override - public Object doGet(BaseRestRequestParam param, UcloudConfig config, String restURL, - UcloudHandler handler, Boolean... asyncFlag) throws Exception { - BaseResponseResult result = null; - try { - RestParamConstructor constructor = new RestParamConstructor(config.getAccount(), param); - List

headerList = constructor.getHeaders(); - Header[] headers = new Header[headerList.size()]; - headers = headerList.toArray(headers); - String restHttpURLParamString = constructor.getRestHttpURLParamString(); - HttpGet get = new HttpGet(String.format("%s?%s", restURL, restHttpURLParamString)); - get.setHeaders(headers); - Http http = new Http(resultClass,config.isEnableLog()); - result = http.doHttp(get, handler, async(asyncFlag)); - } catch (Exception e) { - handlerException(handler, e, async(asyncFlag)); - } - return result; - } - - @Override - public Object doPost(BaseRestRequestParam param, UcloudConfig config, String restURL, - UcloudHandler handler, Boolean... asyncFlag) throws Exception { - BaseResponseResult result = null; - try { - HttpPost post = new HttpPost(restURL); - RestParamConstructor constructor = new RestParamConstructor(config.getAccount(), param); - List
headerList = constructor.getHeaders(); - Header[] headers = new Header[headerList.size()]; - headers = headerList.toArray(headers); - HttpEntity entity = constructor.getEntity(); - post.setEntity(entity); - post.setHeaders(headers); - Http http = new Http(resultClass,config.isEnableLog()); - result = http.doHttp(post, handler, async(asyncFlag)); - } catch (Exception e) { - handlerException(handler, e, async(asyncFlag)); - } - return result; - } - - private Boolean async(Boolean... asyncFlag) { - Boolean async = null; - if (asyncFlag != null && asyncFlag.length > 0) { - async = asyncFlag[0]; - } - return async; - } - - private void handlerException(UcloudHandler handler, Exception e, Boolean async) throws Exception { - if (handler == null) { - if (async != null) { - logger.error("handler is null and async is not null,but get an error:{}", e.getMessage()); - } else { - throw e; - } - } else { - handler.error(e); - } - } - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/BaseMiddleware.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/BaseMiddleware.java new file mode 100644 index 00000000..401360e1 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/BaseMiddleware.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middleware; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +public abstract class BaseMiddleware implements Middleware { + + @Override + public Request handleRequest(Context context) throws UCloudException { + return context.getRequest(); + } + + @Override + public Response handleResponse(Context context) throws UCloudException { + return context.getResponse(); + } + + @Override + public void handleException(Context context) throws UCloudException {} +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Context.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Context.java new file mode 100644 index 00000000..7bf5fcac --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Context.java @@ -0,0 +1,72 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middleware; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +public class Context { + + private Config config; + + private Credential credential; + + private Request request; + + private Response response; + + private Exception exception; + + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public Credential getCredential() { + return credential; + } + + public void setCredential(Credential credential) { + this.credential = credential; + } + + public Request getRequest() { + return request; + } + + public void setRequest(Request request) { + this.request = request; + } + + public Response getResponse() { + return response; + } + + public void setResponse(Response response) { + this.response = response; + } + + public Exception getException() { + return exception; + } + + public void setException(Exception exception) { + this.exception = exception; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Middleware.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Middleware.java new file mode 100644 index 00000000..a746a228 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middleware/Middleware.java @@ -0,0 +1,46 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middleware; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +public interface Middleware { + /** + * Handle the context includes request object + * + * @param context Context of invoking lifecycle + * @return request object that modified + * @throws UCloudException the exception during invoking + */ + Request handleRequest(Context context) throws UCloudException; + + /** + * Handle the context includes response object + * + * @param context Context of invoking lifecycle + * @return response object that modified + * @throws UCloudException the exception during invoking + */ + Response handleResponse(Context context) throws UCloudException; + + /** + * Handle the context includes exception object + * + * @param context Context of invoking lifecycle + * @throws UCloudException the exception during invoking + */ + void handleException(Context context) throws UCloudException; +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/CredentialMiddleware.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/CredentialMiddleware.java new file mode 100644 index 00000000..8e1db0b1 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/CredentialMiddleware.java @@ -0,0 +1,32 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middlewares; + +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.middleware.BaseMiddleware; +import cn.ucloud.common.middleware.Context; +import cn.ucloud.common.middleware.Middleware; +import cn.ucloud.common.request.Request; + +/** CredentialMiddleware is the middleware to calculate signature and inject into request */ +public class CredentialMiddleware extends BaseMiddleware implements Middleware { + + @Override + public Request handleRequest(Context context) throws UCloudException { + Credential cred = context.getCredential(); + Request request = context.getRequest(); + return cred.sign(request); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/LogMiddleware.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/LogMiddleware.java new file mode 100644 index 00000000..51f7b093 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/LogMiddleware.java @@ -0,0 +1,54 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middlewares; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.middleware.BaseMiddleware; +import cn.ucloud.common.middleware.Context; +import cn.ucloud.common.middleware.Middleware; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import com.google.gson.Gson; + +import org.slf4j.Logger; + +/** LogMiddleware is the middleware to print logs */ +public class LogMiddleware extends BaseMiddleware implements Middleware { + + @Override + public Request handleRequest(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.info(new Gson().toJson(context.getRequest().encode())); + return super.handleRequest(context); + } + + @Override + public Response handleResponse(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.info( + String.format( + "[%s] %s", + context.getResponse().getRequestId(), + new Gson().toJson(context.getResponse()))); + return super.handleResponse(context); + } + + @Override + public void handleException(Context context) throws UCloudException { + Logger logger = context.getConfig().getLogger(); + logger.error(new Gson().toJson(context.getException().getMessage())); + super.handleException(context); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/ValidationMiddleware.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/ValidationMiddleware.java new file mode 100644 index 00000000..88459a48 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/middlewares/ValidationMiddleware.java @@ -0,0 +1,44 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.middlewares; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.middleware.BaseMiddleware; +import cn.ucloud.common.middleware.Context; +import cn.ucloud.common.middleware.Middleware; +import cn.ucloud.common.request.Request; + +/** ValidationMiddleware is a middleware to inject common configuration */ +public class ValidationMiddleware extends BaseMiddleware implements Middleware { + + @Override + public Request handleRequest(Context context) throws UCloudException { + Config config = context.getConfig(); + Request request = context.getRequest(); + if (request.loadMaxRetries() == null) { + request.withMaxRetries(config.getMaxRetries()); + } + if (request.loadTimeout() == null) { + request.withTimeout(config.getTimeout() * 1000); + } + if (request.getRegion() == null) { + request.setRegion(config.getRegion()); + } + if (request.getProjectId() == null) { + request.setProjectId(config.getProjectId()); + } + return request; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListParam.java deleted file mode 100755 index 01a13ebc..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListParam.java +++ /dev/null @@ -1,15 +0,0 @@ -package cn.ucloud.common.model; - -import cn.ucloud.common.pojo.BaseRequestParam; - -/** - * @description: 获取项目列表 参数类 - * @author: codezhang - * @date: 2018-11-13 15:19 - **/ - -public class GetProjectListParam extends BaseRequestParam { - public GetProjectListParam() { - super("GetProjectList"); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListResult.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListResult.java deleted file mode 100755 index a1b60071..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetProjectListResult.java +++ /dev/null @@ -1,171 +0,0 @@ -package cn.ucloud.common.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @description: 获取项目列表 结果类 - * @author: codezhang - * @date: 2018-11-13 15:20 - **/ - -public class GetProjectListResult extends BaseResponseResult { - - public static class Project { - - /** - * 创建时间 时间戳 - */ - @SerializedName("CreateTime") - private Integer createTime; - - /** - * 是否是默认的项目 - */ - @SerializedName("IsDefault") - private Boolean isDefault; - - /** - * 成员数目 - */ - @SerializedName("MemberCount") - private Integer memberCount; - - /** - * 父项目ID - */ - @SerializedName("ParentId") - private String parentId; - - /** - * 父项目名称 - */ - @SerializedName("ParentName") - private String parentName; - - - /** - * 项目ID - */ - @SerializedName("ProjectId") - private String projectId; - - /** - * 项目名称 - */ - @SerializedName("ProjectName") - private String projectName; - - /** - * 资源数目 - */ - @SerializedName("ResourceCount") - private Integer resourceCount; - - - public Integer getCreateTime() { - return createTime; - } - - public void setCreateTime(Integer createTime) { - this.createTime = createTime; - } - - public Boolean getDefault() { - return isDefault; - } - - public void setDefault(Boolean aDefault) { - isDefault = aDefault; - } - - public Integer getMemberCount() { - return memberCount; - } - - public void setMemberCount(Integer memberCount) { - this.memberCount = memberCount; - } - - public String getParentId() { - return parentId; - } - - public void setParentId(String parentId) { - this.parentId = parentId; - } - - public String getParentName() { - return parentName; - } - - public void setParentName(String parentName) { - this.parentName = parentName; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public Integer getResourceCount() { - return resourceCount; - } - - public void setResourceCount(Integer resourceCount) { - this.resourceCount = resourceCount; - } - - @Override - public String toString() { - return "Project{" + - "createTime=" + createTime + - ", isDefault=" + isDefault + - ", memberCount=" + memberCount + - ", parentId='" + parentId + '\'' + - ", parentName='" + parentName + '\'' + - ", projectId='" + projectId + '\'' + - ", projectName='" + projectName + '\'' + - ", resourceCount=" + resourceCount + - '}'; - } - } - - /** - * 项目列表 - */ - @SerializedName("ProjectSet") - private List projectList; - - @SerializedName("ProjectCount") - private Integer projectCount; - - public Integer getProjectCount() { - return projectCount; - } - - public void setProjectCount(Integer projectCount) { - this.projectCount = projectCount; - } - - public List getProjectList() { - return projectList; - } - - public void setProjectList(List projectList) { - this.projectList = projectList; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionParam.java deleted file mode 100755 index c41c654f..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionParam.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.ucloud.common.model; - -import cn.ucloud.common.pojo.BaseRequestParam; - -/** - * @description: 获取地域Region信息 参数类 - * @author: codezhang - * @date: 2018-11-13 13:56 - **/ - -public class GetRegionParam extends BaseRequestParam { - - public GetRegionParam() { - super("GetRegion"); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionResult.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionResult.java deleted file mode 100755 index 85d16adc..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/model/GetRegionResult.java +++ /dev/null @@ -1,177 +0,0 @@ -package cn.ucloud.common.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.ArrayList; -import java.util.List; - -import static cn.ucloud.common.util.StringEqual.regionZoneStringEqual; - -/** - * @description: 获取地域Region信息 结果类 - * @author: codezhang - * @date: 2018-11-13 13:56 - **/ - -public class GetRegionResult extends BaseResponseResult { - - - private static class RealRegion { - /** - * region名称,code,地域 - */ - @SerializedName("Region") - private String region; - - /** - * zone名称,code,可用区 - */ - @SerializedName("Zone") - private String zone; - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - @Override - public String toString() { - return "RealRegion{" + - "region='" + region + '\'' + - ", zone='" + zone + '\'' + - '}'; - } - } - - - public static class Region { - - /** - * region名称,code,地域 - */ - private String region; - - - /** - * zone名称,code,可用区 - */ - private List zones; - - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - - public List getZones() { - return zones; - } - - public void setZones(List zones) { - this.zones = zones; - } - - @Override - public String toString() { - return "Region{" + - "region='" + region + '\'' + - ", zones=" + zones + - '}'; - } - } - - /** - * region地域信息 - */ - @SerializedName("Regions") - private List realRegions; - - /** - * region地域信息 - */ - private List regions; - - public List getRegions() { - if (regions == null && realRegions != null) { - regions = new ArrayList<>(); - // 数据转换 - for (RealRegion realRegion : realRegions) { - // region存在标记 - boolean regionFlag = false; - for (Region region : regions) { - if (regionZoneStringEqual(region.region, realRegion.region)) { - // 两个region code相同 - regionFlag = true; - // region已经存在,则判断zone是否存在,不存在则添加 - if (region.zones == null) { - region.zones = new ArrayList<>(); - } - boolean zoneFlag = false; - for (String zone : region.zones) { - if (regionZoneStringEqual(zone, realRegion.zone)) { - // 两个zone code相同 - zoneFlag = true; - break; - } - } - if (!zoneFlag && realRegion.zone != null && realRegion.zone.length() > 0) { - // zone不存在,增加zone到region中 - region.zones.add(realRegion.zone); - } - break; - } - } - if (!regionFlag && realRegion.region != null && realRegion.region.length() > 0) { - Region region = new Region(); - region.region = realRegion.region; - region.zones = new ArrayList<>(); - if (realRegion.zone != null && realRegion.zone.length() > 0){ - region.zones.add(realRegion.zone); - } - regions.add(region); - } - } - } - return regions; - } - - - public void setRegions(List regions) { - this.regions = regions; - } - - - private List getRealRegions() { - return realRegions; - } - - private void setRealRegions(List realRegions) { - this.realRegions = realRegions; - } - - @Override - public String toString() { - return "GetRegionResult{" + - "regions=" + getRegions() + - ", retCode=" + retCode + - ", action='" + action + '\'' + - ", message='" + message + '\'' + - '}'; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Account.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Account.java deleted file mode 100755 index efdb74fc..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Account.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.ucloud.common.pojo; - -/** - * @description: 账户 - * @author: codezhang - * @date: 2018-09-12 18:44 - **/ - -public class Account { - - private String privateKey; - private String publicKey; - - public Account(String privateKey, String publicKey) { - this.privateKey = privateKey; - this.publicKey = publicKey; - } - - public String getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(String privateKey) { - this.privateKey = privateKey; - } - - public String getPublicKey() { - return publicKey; - } - - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRequestParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRequestParam.java deleted file mode 100755 index 6c12b1df..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRequestParam.java +++ /dev/null @@ -1,79 +0,0 @@ -package cn.ucloud.common.pojo; - -import cn.ucloud.common.annotation.UcloudParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @description: 基础请求参数 - * @author: codezhang - * @date: 2018-09-13 17:33 - **/ - -public class BaseRequestParam { - /** - * 对应的API名称,如CreateUHostInstance - */ - @UcloudParam("Action") - @NotEmpty(message = "action can not be empty") - protected String action; - - /** - * require 根据公钥及API指令生成的用户签名,参见https://docs.ucloud.cn/api/summary/signature - */ - @NotEmpty(message = "signature can not be empty") - @UcloudParam("Signature") - protected String signature; - - - /** - * require 用户公钥 - */ - @UcloudParam("PublicKey") - @NotEmpty(message = "publicKey can not be empty") - protected String publicKey; - - - /** - * optional 项目编号(子帐号用),不填写为默认项目,子帐号必须填写, 请参考GetProjectList接口 - */ - @UcloudParam("ProjectId") - protected String projectId; - - public BaseRequestParam(@NotEmpty(message = "action can not be empty") String action) { - this.action = action; - } - - public String getProjectId() { - return projectId; - } - - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getPublicKey() { - return publicKey; - } - - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseResponseResult.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseResponseResult.java deleted file mode 100755 index 99dd5dfd..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseResponseResult.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.ucloud.common.pojo; - -import com.google.gson.Gson; -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -/** - * @description: 基础请求结果 - * @author: codezhang - * @date: 2018-09-14 11:03 - **/ - -public class BaseResponseResult { - /** - * 返回码 0 成功,其他失败 - */ - @SerializedName("RetCode") - protected Integer retCode; - - /** - * 操作名称 = 请求参数Action+"Response" - */ - @SerializedName("Action") - protected String action; - /** - * 提示信息,发生错误时 - */ - @SerializedName("Message") - protected String message; - - /** - * response content 不进行 JsonSerDe - */ - protected transient String responseContent; - - public String getResponseContent() { - return responseContent; - } - - public void setResponseContent(String responseContent) { - this.responseContent = responseContent; - } - - public Integer getRetCode() { - return retCode; - } - - public void setRetCode(Integer retCode) { - this.retCode = retCode; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public String toString() { - return new Gson().toJson(this); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRestRequestParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRestRequestParam.java deleted file mode 100644 index 01d54fdf..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/BaseRestRequestParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.ucloud.common.pojo; - - -import cn.ucloud.common.annotation.UcloudRestParam; -import cn.ucloud.common.http.ParamLocation; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 21:51 - **/ -public class BaseRestRequestParam { - - /** - * require 根据公钥及API指令生成的用户签名,参见https://docs.ucloud.cn/api/summary/signature - */ - @NotEmpty(message = "signature can not be empty") - @UcloudRestParam(name = "Signature", location = ParamLocation.HEADER) - protected String signature; - - - /** - * require 用户公钥 - */ - @UcloudRestParam(name = "PublicKey", location = ParamLocation.HEADER, - signature = true) - @NotEmpty(message = "publicKey can not be empty") - protected String publicKey; - - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - public String getPublicKey() { - return publicKey; - } - - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Param.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Param.java deleted file mode 100755 index ef873c6e..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/Param.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.ucloud.common.pojo; - -/** - * @description: 参数 - * @author: codezhang - * @date: 2018-09-12 18:55 - **/ - -public class Param { - private String paramKey; - private Object paramValue; - - public Param(String paramKey, Object paramValue) { - this.paramKey = paramKey; - this.paramValue = paramValue; - } - - public String getParamKey() { - return paramKey; - } - - public void setParamKey(String paramKey) { - this.paramKey = paramKey; - } - - public Object getParamValue() { - return paramValue; - } - - public void setParamValue(Object paramValue) { - this.paramValue = paramValue; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/UcloudConfig.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/UcloudConfig.java deleted file mode 100755 index d0e4ea60..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/pojo/UcloudConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.ucloud.common.pojo; - -/** - * @description: 环境配置参数对象 - * @author: codezhang - * @date: 2018-09-13 19:19 - **/ - -public class UcloudConfig { - - /** - * client的账户信息 - */ - private Account account; - - private String apiServerAddr = "https://api.ucloud.cn"; - - private boolean enableLog = false; - - public boolean isEnableLog() { - return enableLog; - } - - public UcloudConfig setEnableLog(boolean enableLog) { - this.enableLog = enableLog; - return this; - } - - public UcloudConfig(Account account) { - this.account = account; - } - - public Account getAccount() { - return account; - } - - public String getApiServerAddr() { - return apiServerAddr; - } - - public void setAccount(Account account) { - this.account = account; - } - - public void setApiServerAddr(String apiServerAddr) { - this.apiServerAddr = apiServerAddr; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/Request.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/Request.java new file mode 100644 index 00000000..257ec70c --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/Request.java @@ -0,0 +1,169 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.request; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.exception.ValidatorException; + +import java.lang.reflect.Field; +import java.util.*; + +/** Request is the base-class of all request object */ +public class Request extends RequestOptions { + @UCloudParam("Signature") + private String signature; + + @UCloudParam("Action") + private String action; + + @UCloudParam("PublicKey") + private String publicKey; + + @UCloudParam("Region") + private String region; + + @UCloudParam("ProjectId") + private String projectId; + + public Request() {} + + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + /** + * Encode will encode the request object to a map + * + * @return map representation of request + */ + public Map encode() throws UCloudException { + try { + return encodeObject(this); + } catch (ClassNotFoundException | IllegalAccessException e) { + throw new UCloudException("cannot encode: " + e.getMessage(), e); + } + } + + private static Map encodeObject(Object obj) + throws ClassNotFoundException, IllegalAccessException, UCloudException { + Map params = new HashMap<>(); + + for (Field field : getAllFields(obj.getClass())) { + // only collect field with param paramAnnotation + UCloudParam paramAnnotation = field.getAnnotation(UCloudParam.class); + if (paramAnnotation == null) { + continue; + } + String key = paramAnnotation.value(); + NotEmpty requiredAnnotation = field.getAnnotation(NotEmpty.class); + + // get field value + field.setAccessible(true); + Object value = field.get(obj); + if (requiredAnnotation != null && value == null) { + throw new ValidatorException( + String.format("%s can not be null", paramAnnotation.value())); + } + if (value == null) { + continue; + } + + // visit field recursive + if (isPrimitive(value)) { + params.put(key, value); + } else if (isArray(value)) { + List listValue = (List) value; + for (int i = 0; i < listValue.size(); i++) { + Object item = listValue.get(i); + if (isObject(item)) { + for (Map.Entry entry : encodeObject(item).entrySet()) { + params.put( + String.format("%s.%d.%s", key, i, entry.getKey()), + entry.getValue()); + } + } else { + params.put(String.format("%s.%d", key, i), item); + } + } + } else if (isObject(value)) { + for (Map.Entry entry : encodeObject(value).entrySet()) { + params.put(String.format("%s.%s", key, entry.getKey()), entry.getValue()); + } + } else { + throw new ClassNotFoundException( + "invalid class ".concat(value.getClass().getName())); + } + } + return params; + } + + private static Boolean isArray(Object value) { + return (value instanceof List); + } + + private static Boolean isObject(Object value) { + return value instanceof Request; + } + + private static Boolean isPrimitive(Object value) { + return (value instanceof Number || value instanceof String || value instanceof Boolean); + } + + private static List getAllFields(Class type) { + List fields = new ArrayList<>(Arrays.asList(type.getDeclaredFields())); + + if (type.getSuperclass() != null) { + fields.addAll(getAllFields(type.getSuperclass())); + } + return fields; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/RequestOptions.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/RequestOptions.java new file mode 100644 index 00000000..cdd4ba79 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/request/RequestOptions.java @@ -0,0 +1,38 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.request; + +/** RequestOptions is the options to control the request behavior */ +class RequestOptions { + + private Integer $maxRetries = 3; + + private Integer $timeout; + + public Integer loadMaxRetries() { + return $maxRetries; + } + + public void withMaxRetries(Integer maxRetries) { + this.$maxRetries = maxRetries; + } + + public Integer loadTimeout() { + return $timeout; + } + + public void withTimeout(Integer timeout) { + this.$timeout = timeout; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/response/Response.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/response/Response.java new file mode 100644 index 00000000..aed94905 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/response/Response.java @@ -0,0 +1,63 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.response; + +import com.google.gson.annotations.SerializedName; + +/** Response is the base-class of all response object */ +public class Response { + + @SerializedName("RetCode") + private Integer retCode; + + @SerializedName("Message") + private String message; + + @SerializedName("Action") + private String action; + + private String requestId; + + public String getRequestId() { + return requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public Integer getRetCode() { + return retCode; + } + + public void setRetCode(Integer retCode) { + this.retCode = retCode; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/DefaultTransport.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/DefaultTransport.java new file mode 100644 index 00000000..f2650821 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/DefaultTransport.java @@ -0,0 +1,130 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.transport; + +import cn.ucloud.common.exception.TransportException; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import com.google.gson.Gson; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.StatusLine; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.protocol.HTTP; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** DefaultTransport is the default implementation of transport */ +public class DefaultTransport implements Transport { + + private static final String HEADER_REQUEST_ID = "X-UCLOUD-REQUEST-UUID"; + + private String baseUrl; + + private String userAgent; + + private CloseableHttpClient httpClient; + + public DefaultTransport(String baseUrl, String userAgent) { + this.setBaseUrl(baseUrl); + this.setUserAgent(userAgent); + this.httpClient = HttpClients.createDefault(); + } + + @Override + public Response invoke(Request request, Class clazz) + throws UCloudException { + HttpPost httpPost = new HttpPost(this.getBaseUrl()); + + // inject user agent + String ua = + String.format("Java/%s Java-SDK/%s", System.getProperty("java.version"), "1.0.0"); + if (!StringUtils.isEmpty(this.getUserAgent())) { + ua = ua.concat(" ").concat(this.getUserAgent()); + } + httpPost.setHeader(HTTP.USER_AGENT, ua); + + // build request body + Map params = request.encode(); + StringEntity entity = new StringEntity(new Gson().toJson(params), StandardCharsets.UTF_8); + entity.setContentType(ContentType.APPLICATION_JSON.getMimeType()); + httpPost.setHeader(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType()); + httpPost.setEntity(entity); + // invoke http requesting + try (CloseableHttpResponse httpResponse = this.getHttpClient().execute(httpPost)) { + String requestId = ""; + if (httpResponse.getLastHeader(HEADER_REQUEST_ID) != null) { + requestId = httpResponse.getLastHeader(HEADER_REQUEST_ID).getValue(); + } + + // check http status + StatusLine httpStatus = httpResponse.getStatusLine(); + if (httpStatus.getStatusCode() >= 400) { + throw new UCloudException( + String.format( + "http error, status code %d %s", + httpStatus.getStatusCode(), httpStatus.getReasonPhrase())); + } + + // decode response + String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); + Response response = new Gson().fromJson(content, clazz); + response.setRequestId(requestId); + return response; + } catch (UCloudException e) { + throw e; + } catch (Exception e) { + throw new TransportException("http error", e); + } + } + + public String getBaseUrl() { + return baseUrl; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + public CloseableHttpClient getHttpClient() { + return httpClient; + } + + public void setHttpClient(CloseableHttpClient httpClient) { + this.httpClient = httpClient; + } + + @Override + public void close() throws IOException { + this.httpClient.close(); + } +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/Transport.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/Transport.java new file mode 100644 index 00000000..b2123080 --- /dev/null +++ b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/transport/Transport.java @@ -0,0 +1,30 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.common.transport; + +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import java.io.Closeable; + +public interface Transport extends Closeable { + /** + * @param request Request payload with data + * @param clazz Response class without data + * @return Response + * @throws UCloudException exception + */ + Response invoke(Request request, Class clazz) throws UCloudException; +} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/FormatUtil.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/FormatUtil.java deleted file mode 100755 index 4d8c70ef..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/FormatUtil.java +++ /dev/null @@ -1,109 +0,0 @@ -package cn.ucloud.common.util; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Random; - - -/** - * @description: - * @author: joshua - * @E-mail: joshua.yin@ucloud.cn - * @date: 2018/9/18 10:37 - */ - -public class FormatUtil { - - private static Logger logger = LoggerFactory.getLogger(FormatUtil.class.getName()); - - public static int BCD2Int(byte data) { - data &= 0xff; - int low = data & 0xf; - int high = (data >> 4) & 0xf; - int res = high * 10 + low; - return res; - } - - public static byte Int2BCD(int data) { - return (byte) ((Integer.parseInt(Integer.toString(data), 16)) & 0xff); - } - - public static String makeHexRandomString(int byteSize) { - if (byteSize < 1){ - return ""; - } - Random random = new Random(System.currentTimeMillis()); - StringBuilder sb = new StringBuilder(); - int times = (int) Math.ceil(byteSize / 4.f); - - for (int i = 0; i < times; i++) { - int intRnd = random.nextInt(); - for (int j = 0; j < 4; j++){ - sb.append(String.format("%02X", ((intRnd >> (j * 8)) & 0xff))); - } - } - String rnd = sb.toString(); - return rnd.substring(0, byteSize * 2); - } - - public static byte[] formatHexString2ByteArray(String str) { - if (StringUtils.isBlank(str)){ - return null; - } - int byteLen = (int) Math.ceil(str.length() / 2.f); - return formatHexString2ByteArray(str, byteLen); - } - - public static byte[] formatHexString2ByteArray(String str, int byteLen) { - if (StringUtils.isBlank(str)){ - return null; - } - str = str.trim(); - str = str.replace(" ", ""); - int dlt = str.length() - byteLen * 2; - if (dlt > 0) { - str = str.substring(dlt, str.length()); - } else if (dlt < 0) { - dlt = Math.abs(dlt); - while (dlt > 0) { - str = "0" + str; - dlt -= 1; - } - } - byte[] arr = new byte[byteLen]; - try { - for (int i = 0; i < byteLen; i++){ - arr[i] = (byte) Integer.parseInt(str.substring(i * 2, i * 2 + 2), 16); - } - } catch (Exception e) { - logger.error(e.getMessage()); - return null; - } - return arr; - } - - public static String formatBytes2HexString(byte[] data, boolean isUpperCase) { - if (data == null || data.length == 0){ - return ""; - } - StringBuilder sb = new StringBuilder(); - for (byte b : data){ - sb.append(String.format("%02x", b)); - } - return isUpperCase ? sb.toString().toUpperCase() : sb.toString(); - } - - public static String formatBytes2HexString(List data, boolean isUpperCase) { - if (data == null || data.isEmpty()){ - return ""; - } - StringBuilder sb = new StringBuilder(); - for (byte b : data){ - sb.append(String.format("%02x", b)); - } - return isUpperCase ? sb.toString().toUpperCase() : sb.toString(); - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/GetAndSetUtil.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/GetAndSetUtil.java deleted file mode 100755 index 22c4790e..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/GetAndSetUtil.java +++ /dev/null @@ -1,65 +0,0 @@ -package cn.ucloud.common.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -/** - * @description: java model 工具 - * @author: codezhang - * @date: 2018-09-17 16:06 - **/ - -public class GetAndSetUtil { - - private static Logger logger = LoggerFactory.getLogger(GetAndSetUtil.class.getName()); - - /** - * java反射bean的get方法 - * - * @param objectClass - * @param fieldName - * @return - */ - @SuppressWarnings("unchecked") - public static Method getGetMethod(Class objectClass, String fieldName) { - StringBuilder sb = new StringBuilder(); - sb.append("get"); - sb.append(fieldName.substring(0, 1).toUpperCase()); - sb.append(fieldName.substring(1)); - try { - return objectClass.getMethod(sb.toString()); - } catch (Exception e) { - logger.error(e.getMessage()); - } - return null; - } - - - /** - * java反射bean的set方法 - * - * @param objectClass - * @param fieldName - * @return - */ - @SuppressWarnings("unchecked") - public static Method getSetMethod(Class objectClass, String fieldName) { - try { - Class[] parameterTypes = new Class[1]; - Field field = objectClass.getDeclaredField(fieldName); - parameterTypes[0] = field.getType(); - StringBuilder sb = new StringBuilder(); - sb.append("set"); - sb.append(fieldName.substring(0, 1).toUpperCase()); - sb.append(fieldName.substring(1)); - return objectClass.getMethod(sb.toString(), parameterTypes); - } catch (Exception e) { - logger.error(e.getMessage()); - } - return null; - } - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ObjectToParam.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ObjectToParam.java deleted file mode 100755 index ce7c540e..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ObjectToParam.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -/** - * @description: 参数对象转param - * @author: codezhang - * @date: 2018-09-13 12:58 - **/ - -public class ObjectToParam { - - /** - * 参数对象转param数组 - * - * @param baseRequestParam 参数对象 - * @return 参数数组 - * @throws Exception 可能是NullPointerException或者ValidatorException - */ - public static List objectToParams(BaseRequestParam baseRequestParam) throws Exception { - List params = new ArrayList<>(); - if (baseRequestParam != null) { - Class objectClass = baseRequestParam.getClass(); - params.addAll(getFieldParam(objectClass, baseRequestParam)); - params.addAll(getMethodParam(objectClass, baseRequestParam)); - - Class superclass = objectClass.getSuperclass(); - while (!superclass.isAssignableFrom(Object.class)){ - params.addAll(getFieldParam(superclass, baseRequestParam)); - params.addAll(getMethodParam(superclass, baseRequestParam)); - superclass = superclass.getSuperclass(); - } - } else { - throw new NullPointerException("param object can not be null"); - } - return params; - } - - - /** - * 根据类对象 获取属性参数 - * - * @param clazz 类对象的class - * @param baseRequestParam 类对象 - * @return 属性参数列表 - * @throws Exception 不满足要求的参数 抛出异常 - */ - private static List getFieldParam(Class clazz, BaseRequestParam baseRequestParam) throws Exception { - List list = new ArrayList<>(); - if (clazz != null) { - Field[] declaredFields = clazz.getDeclaredFields(); - int len = clazz.getDeclaredFields().length; - for (int i = 0; i < len; i++) { - UcloudParam annotation = declaredFields[i].getAnnotation(UcloudParam.class); - if (annotation != null) { - declaredFields[i].setAccessible(true); - Object value = declaredFields[i].get(baseRequestParam); - if (value != null) { - Param param = new Param(annotation.value(), value); - list.add(param); - } - } - } - } - return list; - } - - - /** - * 根据类对象 获取方法参数 - * - * @param clazz 类对象的class - * @param baseRequestParam 类对象 - * @return 方法参数列表 - * @throws Exception 对不满足要求的参数 抛出异常 - */ - private static List getMethodParam(Class clazz, BaseRequestParam baseRequestParam) throws Exception { - List list = new ArrayList<>(); - if (clazz != null) { - Method[] declaredMethods = clazz.getDeclaredMethods(); - int len = declaredMethods.length; - for (int i = 0; i < len; i++) { - UcloudParam annotation = declaredMethods[i].getAnnotation(UcloudParam.class); - if (annotation != null) { - declaredMethods[i].setAccessible(true); - Object invoke = declaredMethods[i].invoke(baseRequestParam); - if (invoke instanceof List) { - List params = (List) invoke; - list.addAll(params); - } - } - } - } - return list; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamConstructor.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamConstructor.java deleted file mode 100755 index 32737f48..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamConstructor.java +++ /dev/null @@ -1,86 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; -import com.google.gson.Gson; -import org.apache.commons.lang3.StringUtils; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @description: http请求参数构造器 - * @author: codezhang - * @date: 2018-09-13 17:37 - **/ - -public class ParamConstructor { - - - /** - * 将参数对象 构造成http GET请求的参数字符串 - * - * @param baseRequestParam 参数对象 - * @return GET请求的请求数据字符串 - * @throws Exception 可能是NullPointerException(参数对象为空)或者ValidatorException(参数对象属性不满足要求) - */ - public static String getHttpGetParamString(BaseRequestParam baseRequestParam, Account account) throws Exception { - // 设置publicKey - baseRequestParam.setPublicKey(account.getPublicKey()); - // 将参数对象转成List - List paramList = ObjectToParam.objectToParams(baseRequestParam); - // 获取签名字符串 - String signature = Signature.getSignature(paramList, account); - // 设置签名 到参数对象 - baseRequestParam.setSignature(signature); - // 参数校验 - ParamValidator.validator(baseRequestParam); - // url编码 - Signature.urlEncodeParams(paramList); - // 构造url参数 - StringBuilder builder = new StringBuilder(); - for (Param param : paramList) { - if (StringUtils.isBlank(param.getParamKey())) { - continue; - } - builder.append(param.getParamKey() + "=" + param.getParamValue() + "&"); - } - // 设置签名 - builder.append("Signature" + "=" + signature); - return builder.toString(); - } - - - /** - * 将参数对象 构造成http POST请求的参数字符串 - * - * @param baseRequestParam 参数对象 - * @return POST请求的请求数据 - * @throws Exception 可能是NullPointerException(参数对象为空)或者ValidatorException(参数对象属性不满足要求) - */ - public static String getHttpPostParamString(BaseRequestParam baseRequestParam, Account account) throws Exception { - // 设置publicKey - baseRequestParam.setPublicKey(account.getPublicKey()); - // 将参数对象转成List - List paramList = ObjectToParam.objectToParams(baseRequestParam); - // 获取签名字符串 - String signature = Signature.getSignature(paramList, account); - // 设置签名 到参数对象 - baseRequestParam.setSignature(signature); - // 参数校验 - ParamValidator.validator(baseRequestParam); - // url编码 - //Signature.urlEncodeParams(paramList); - // 设置签名 - paramList.add(new Param("Signature", signature)); - // 构造参数 - Map paramMap = new HashMap<>(); - for (Param param : paramList) { - paramMap.put(param.getParamKey(), param.getParamValue()); - } - return new Gson().toJson(paramMap); - } - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamValidator.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamValidator.java deleted file mode 100755 index ace27d5b..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ParamValidator.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.exception.ValidatorException; - -import javax.validation.*; -import java.util.Iterator; -import java.util.Set; - -/** - * @description: 参数校验工具 - * @author: codezhang - * @date: 2018-09-13 11:20 - **/ - -public class ParamValidator { - - /** - * 校验器工厂 - */ - private static ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - - public static void validator(T obj) throws ValidatorException { - Validator validator = factory.getValidator(); - Set> constraintViolations = validator - .validate(obj); - Iterator> it = constraintViolations - .iterator(); - while (it.hasNext()) { - ConstraintViolation e = it.next(); - throw new ValidatorException(e.getMessage()); - } - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamAnalyzer.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamAnalyzer.java deleted file mode 100644 index 32d5deb7..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamAnalyzer.java +++ /dev/null @@ -1,219 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.annotation.UcloudMethod; -import cn.ucloud.common.annotation.UcloudRestParam; -import cn.ucloud.common.http.HttpContentType; -import cn.ucloud.common.http.HttpMethod; -import cn.ucloud.common.http.ParamLocation; -import cn.ucloud.common.pojo.BaseRestRequestParam; -import cn.ucloud.common.pojo.Param; -import org.apache.http.Header; -import org.apache.http.message.BasicHeader; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 18:07 - **/ -public class RestParamAnalyzer { - - private BaseRestRequestParam baseRestRequestParam; - - private List

headers; - - private List pathParams; - - private List bodyParams; - - private List urlParams; - - private List signatureParams; - - private HttpMethod method; - - private HttpContentType contentType; - - public RestParamAnalyzer(BaseRestRequestParam baseRestRequestParam) throws Exception { - this.baseRestRequestParam = baseRestRequestParam; - analyzeParam(); - } - - private void analyzeParam() throws Exception { - if (baseRestRequestParam == null) { - return; - } - Class clazz = baseRestRequestParam.getClass(); - UcloudMethod clazzAnnotation = clazz.getAnnotation(UcloudMethod.class); - if (clazzAnnotation == null) { - method = HttpMethod.GET; - } else { - method = clazzAnnotation.method(); - contentType = clazzAnnotation.contentType(); - } - switch (method) { - case GET: - case DELETE: - urlParams = new ArrayList<>(); - break; - case PUT: - case POST: - bodyParams = new ArrayList<>(); - break; - } - headers = new ArrayList<>(); - pathParams = new ArrayList<>(); - signatureParams = new ArrayList<>(); - analyzeFieldParam(baseRestRequestParam.getClass(),baseRestRequestParam); - analyzeFieldParam(baseRestRequestParam.getClass().getSuperclass(),baseRestRequestParam); - analyzeMethodParam(baseRestRequestParam.getClass(),baseRestRequestParam); - analyzeMethodParam(baseRestRequestParam.getClass().getSuperclass(),baseRestRequestParam); - } - - private void analyzeFieldParam(Class clazz,BaseRestRequestParam baseRestRequestParam) throws Exception { - if (clazz == null){ - return; - } - Field[] declaredFields = clazz.getDeclaredFields(); - int len = declaredFields.length; - for (int i = 0; i < len; i++) { - UcloudRestParam annotation = declaredFields[i].getAnnotation(UcloudRestParam.class); - if (annotation == null) { - continue; - } - declaredFields[i].setAccessible(true); - Object value = declaredFields[i].get(baseRestRequestParam); - String name = annotation.name(); - ParamLocation location = annotation.location(); - boolean signature = annotation.signature(); - List params = new ArrayList<>(); - if (value instanceof List) { - for (Object obj : (List) value) { - params.add(new Param(name, obj)); - } - } else { - params.add(new Param(name, value)); - } - switch (location) { - case URL: { - if (urlParams != null) { - urlParams.addAll(params); - } - break; - } - case BODY: { - if (bodyParams != null) { - bodyParams.addAll(params); - } - break; - } - case PATH: { - if (pathParams != null) { - pathParams.addAll(params); - } - break; - } - case HEADER: { - if (headers != null && value != null) { - headers.add(new BasicHeader(name, value.toString())); - } - break; - } - } - if (signature) { - if (signatureParams != null) { - signatureParams.addAll(params); - } - } - } - } - - private void analyzeMethodParam(Class clazz,BaseRestRequestParam baseRestRequestParam) throws Exception { - if (clazz == null){ - return; - } - Method[] declaredMethods = clazz.getDeclaredMethods(); - int len = declaredMethods.length; - for (int i = 0; i < len; i++) { - UcloudRestParam annotation = declaredMethods[i].getAnnotation(UcloudRestParam.class); - if (annotation != null) { - declaredMethods[i].setAccessible(true); - Object invokeValue = declaredMethods[i].invoke(baseRestRequestParam); - ParamLocation location = annotation.location(); - boolean signature = annotation.signature(); - if (invokeValue instanceof List) { - List params = (List) invokeValue; - switch (location) { - case URL: { - if (urlParams != null) { - urlParams.addAll(params); - } - break; - } - case BODY: { - if (bodyParams != null) { - bodyParams.addAll(params); - } - break; - } - case PATH: { - if (pathParams != null) { - pathParams.addAll(params); - } - break; - } - case HEADER: { - if (headers != null) { - for (Param param : params) { - if (param.getParamValue() == null){ - continue; - } - headers.add(new BasicHeader(param.getParamKey(), - param.getParamValue().toString())); - } - } - break; - } - } - if (signature) { - if (signatureParams != null) { - signatureParams.addAll(params); - } - } - } - } - } - } - - public List
getHeaders() { - return headers; - } - - public List getPathParams() { - return pathParams; - } - - public List getBodyParams() { - return bodyParams; - } - - public List getUrlParams() { - return urlParams; - } - - public HttpMethod getMethod() { - return method; - } - - public List getSignatureParams() { - return signatureParams; - } - - public HttpContentType getContentType() { - return contentType; - } -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamConstructor.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamConstructor.java deleted file mode 100644 index a636e1d7..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/RestParamConstructor.java +++ /dev/null @@ -1,191 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.BaseRestRequestParam; -import cn.ucloud.common.pojo.Param; -import com.google.gson.Gson; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicHeader; -import org.apache.http.message.BasicNameValuePair; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-17 19:12 - **/ -public class RestParamConstructor { - - private static final String CHARSET = "UTF-8"; - - private static final String KEY_SIGNATUR = "Signature"; - - private static final String KEY_PUBLIC_KEY = "PublicKey"; - - private HttpEntity entity; - - private String restHttpURLParamString; - - private List
headers; - - private List pathParams; - - private Account account; - - private BaseRestRequestParam baseRestRequestParam; - - private RestParamAnalyzer analyzer; - - private String signature; - - private static final Logger logger = LoggerFactory.getLogger(RestParamConstructor.class); - - public RestParamConstructor(Account account, BaseRestRequestParam baseRestRequestParam) throws Exception { - this.account = account; - this.baseRestRequestParam = baseRestRequestParam; - baseRestRequestParam.setPublicKey(account.getPublicKey()); - analyzer = new RestParamAnalyzer(baseRestRequestParam); - this.headers = analyzer.getHeaders(); - this.pathParams = analyzer.getPathParams(); -// logger.info("body params:{}", new Gson().toJson(analyzer.getBodyParams())); -// logger.info("path params:{}", new Gson().toJson(analyzer.getPathParams())); -// logger.info("url params:{}", new Gson().toJson(analyzer.getUrlParams())); -// logger.info("signature params:{}", new Gson().toJson(analyzer.getSignatureParams())); -// logger.info("headers:{}", new Gson().toJson(headers)); - switch (analyzer.getMethod()) { - case POST: - case PUT: - buildRestHttpBodyParam(); - break; - case GET: - case DELETE: - buildRestHttpURLParam(); - break; - } - buildHeaders(); - } - - public String getRestHttpURLParamString() { - return restHttpURLParamString; - } - - public HttpEntity getEntity() { - return entity; - } - - public List
getHeaders() { - return headers; - } - - public List getPathParams() { - return pathParams; - } - - private void buildRestHttpURLParam() throws Exception { - // 获取签名字符串 - signature = Signature.getSignature(analyzer.getSignatureParams(), account); - // 设置签名 到参数对象 - baseRestRequestParam.setSignature(signature); - // 参数校验 - ParamValidator.validator(baseRestRequestParam); - // url编码 - Signature.urlEncodeParams(analyzer.getUrlParams()); - baseRestRequestParam.setSignature(signature); - // 构造url参数 - StringBuilder builder = new StringBuilder(); - for (Param param : analyzer.getUrlParams()) { - if (StringUtils.isBlank(param.getParamKey())) { - continue; - } - builder.append(param.getParamKey() + "=" + param.getParamValue() + "&"); - } - // 设置签名 - builder.append(KEY_SIGNATUR + "=" + signature); - restHttpURLParamString = builder.toString(); - } - - private void buildHeaders() { - headers.add(new BasicHeader(KEY_SIGNATUR, signature)); - //headers.add(new BasicHeader("PublicKey", account.getPublicKey())); - } - - private void buildRestHttpBodyParam() throws Exception { - // 获取签名字符串 - signature = Signature.getSignature(analyzer.getSignatureParams(), account); - // 设置签名 到参数对象 - baseRestRequestParam.setSignature(signature); - // 参数校验 - ParamValidator.validator(baseRestRequestParam); - // url编码 - // Signature.urlEncodeParams(analyzer.getBodyParams()); - - switch (analyzer.getContentType()) { - case APPLICATION_URL_ENCODED: { - buildURLEncodedFormData(); - break; - } - case MULTIPART_FORM_DATA: { - buildMultiPartFormData(); - break; - } - case APPLICATION_JSON: { - buildJSONFormData(); - break; - } - } - } - - private void buildURLEncodedFormData() { - List pairs = new ArrayList<>(); - if (analyzer.getBodyParams() != null) { - for (Param param : analyzer.getBodyParams()) { - BasicNameValuePair pair = new BasicNameValuePair(param.getParamKey(), - param.getParamValue().toString()); - pairs.add(pair); - } - } - entity = new UrlEncodedFormEntity(pairs, Charset.forName(CHARSET)); - } - - private void buildJSONFormData() { - String json = new Gson().toJson(baseRestRequestParam); - entity = new StringEntity(json, CHARSET); - } - - - private void buildMultiPartFormData() { - MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - builder.setCharset(Charset.forName(CHARSET)); - // 添加参数 - if (analyzer.getBodyParams() != null) { - for (Param param : analyzer.getBodyParams()) { - if (param.getParamValue() == null) { - continue; - } - if (param.getParamValue() instanceof File) { - builder.addBinaryBody(param.getParamKey(), (File) param.getParamValue()); - } else { - builder.addTextBody(param.getParamKey(), - param.getParamValue().toString()); - } - } - } - // 设置签名 - builder.addTextBody(KEY_SIGNATUR, signature); - builder.addTextBody(KEY_PUBLIC_KEY, account.getPublicKey()); - entity = builder.build(); - } - - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/Signature.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/Signature.java deleted file mode 100755 index 6a0b5233..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/Signature.java +++ /dev/null @@ -1,263 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.Param; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -/** - * @description: 签名工具类 - * @author: codezhang - * @date: 2018-09-12 18:42 - **/ - - -public class Signature { - - private static Logger logger = LoggerFactory.getLogger(Signature.class.getName()); - - /** - * 获取签名字符串 - * - * @param params 参数数组 - * @return 签名字符串 - */ - protected static String getSignature(Param[] params, Account account) { - String signature = ""; - if (params != null) { - // 排序 - sortParams(params); - // 拼接参数 - String stitchParams = stitchParams(params); - // 拼接privateKey - stitchParams += account.getPrivateKey(); - // 签名 - signature = sha1(stitchParams); - } - return signature; - } - - /** - * 获取签名字符串 - * - * @param params 参数列表 - * @return 签名字符串 - */ - protected static String getSignature(List params, Account account) { - String signature = ""; - if (params != null) { - // 排序 - sortParams(params); - // 拼接参数 - String stitchParams = stitchParams(params); - // 拼接privateKey - stitchParams += account.getPrivateKey(); - // 签名 - signature = sha1(stitchParams); - } - return signature; - } - - /** - * @param params 参数数组 - * @return 签名后的参数数组 - */ - protected static Param[] getParamAfterSignature(Param[] params, Account account) { - if (params == null) { - params = new Param[0]; - } - Object[] objects = insertElement2Array(params, new Param("signature", getSignature(params, account)), params.length); - if (objects == null) { - objects = new Param[0]; - } - int len = objects.length; - Param[] newParams = new Param[len]; - for (int i = 0; i < len; i++) { - if (objects[i] instanceof Param) { - newParams[i] = (Param) objects[i]; - } - } - return newParams; - } - - /** - * @param params 参数列表 - * @return 签名后的参数列表 - */ - protected static List getParamAfterSignature(List params, Account account) { - if (params != null) { - params.add(new Param("signature", getSignature(params, account))); - } - return params; - } - - - /** - * 对参数按照key的升序进行排序 - * - * @param params 参数数组 - */ - protected static void sortParams(Param[] params) { - int num = params.length; - for (int i = 0; i < num; i++) { - for (int j = i + 1; j < num; j++) { - if (params[i].getParamKey().compareTo(params[j].getParamKey()) > 0) { - Param param = params[i]; - params[i] = params[j]; - params[j] = param; - } - } - } - } - - - /** - * 参数排序 - * - * @param params 参数列表 - */ - protected static void sortParams(List params) { - if (params != null) { - // 排序 - Collections.sort(params, new Comparator() { - @Override - public int compare(Param p1, Param p2) { - return p1.getParamKey().compareTo(p2.getParamKey()); - } - }); - } - } - - /** - * 对参数进行url编码 - * - * @param params 参数数组 - */ - protected static void urlEncodeParams(Param[] params) { - if (params != null) { - int num = params.length; - for (int i = 0; i < num; i++) { - try { - params[i].setParamValue(URLEncoder.encode(params[i].getParamValue().toString(), "utf-8")); - } catch (UnsupportedEncodingException e) { - logger.error(e.getMessage()); - } - } - } - } - - - /** - * 对参数进行Url编码 - * - * @param params 参数列表 - */ - protected static void urlEncodeParams(List params) { - if (params != null) { - for (Param param : params) { - try { - param.setParamValue(URLEncoder.encode(param.getParamValue().toString(), "utf-8")); - } catch (UnsupportedEncodingException e) { - logger.error(e.getMessage()); - } - } - } - } - - - /** - * 获取签名串 - * - * @param params 签名参数 - * @return 待签名的签名串 - */ - public static String stitchParams(Param[] params) { - StringBuilder builder = new StringBuilder(); - if (params != null) { - int num = params.length; - for (int i = 0; i < num; i++) { - builder.append(params[i].getParamKey()); - builder.append(params[i].getParamValue()); - } - } - return builder.toString(); - } - - - /** - * 获取签名串 - * - * @param params 参数列表 - * @return 待签名的签名串 - */ - public static String stitchParams(List params) { - StringBuilder builder = new StringBuilder(); - if (params != null) { - for (Param param : params) { - if (param.getParamValue() == null){ - continue; - } - builder.append(param.getParamKey()); - builder.append(param.getParamValue()); - } - } - return builder.toString(); - } - - - /** - * sha1加密 - * - * @param decrypt 待加密的字符串 - * @return 加密后的字符串 - */ - public static String sha1(String decrypt) { - try { - MessageDigest digest = java.security.MessageDigest - .getInstance("SHA-1"); - digest.update(decrypt.getBytes()); - byte[] messageDigest = digest.digest(); - // Create Hex String - return FormatUtil.formatBytes2HexString(messageDigest, false); - - } catch (NoSuchAlgorithmException e) { - logger.error(e.getMessage()); - } - return ""; - } - - /** - * 数组插入元素 - * - * @param objects 原数组 - * @param element 元素 - * @param index 插入下标 - * @return 新数组 - */ - private static Object[] insertElement2Array(Object[] objects, Object element, int index) { - Object[] newObjs = null; - if (objects != null) { - if (objects[0].getClass().equals(element.getClass())) { - int len = objects.length; - newObjs = new Object[len + 1]; - System.arraycopy(objects, 0, newObjs, 0, index); - newObjs[index] = element; - System.arraycopy(objects, index, newObjs, index, len - index); - } - } else { - newObjs = new Object[1]; - newObjs[0] = element; - } - return newObjs; - } - - -} diff --git a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/StringEqual.java b/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/StringEqual.java deleted file mode 100755 index 0a392788..00000000 --- a/ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/StringEqual.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.ucloud.common.util; - -/** - * @description: - * @author: codezhang - * @date: 2018-11-13 14:40 - **/ - -public class StringEqual { - - /** - * 判断两个region 或者 zone的code是否一致 - * @param a regionA zoneA - * @param b regionB zoneB - * @return true 一致,false 不一致 - */ - public static boolean regionZoneStringEqual(String a, String b) { - if (a != null && b != null && a.length() > 0 && b.length() > 0 && a.equals(b)) { - return true; - } else { - return false; - } - } - -} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/ConfigTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/ConfigTest.java new file mode 100644 index 00000000..41e0e80a --- /dev/null +++ b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/ConfigTest.java @@ -0,0 +1,59 @@ +package cn.ucloud.common.accessor; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.exception.RetCodeException; +import cn.ucloud.common.exception.ValidatorException; + +import org.junit.Assert; +import org.junit.Test; +import org.slf4j.Logger; + +public class ConfigTest { + + @Test + public void testCaseConfigAccessor() { + Config cfg = new Config(); + + String baseUrl = "https://api.ucloud.cn"; + cfg.setBaseUrl(baseUrl); + Assert.assertEquals(baseUrl, cfg.getBaseUrl()); + + String region = "cn-bj2"; + cfg.setRegion(region); + Assert.assertEquals(region, cfg.getRegion()); + + String projectId = "org-xxx"; + cfg.setProjectId(projectId); + Assert.assertEquals(projectId, cfg.getProjectId()); + + String userAgent = "Demo/0.42"; + cfg.setUserAgent(userAgent); + Assert.assertEquals(userAgent, cfg.getUserAgent()); + + Integer timeout = 1; + cfg.setTimeout(timeout); + Assert.assertEquals(timeout, cfg.getTimeout()); + + Integer maxRetries = 1; + cfg.setMaxRetries(maxRetries); + Assert.assertEquals(maxRetries, cfg.getMaxRetries()); + + Logger logger = null; + cfg.setLogger(logger); + Assert.assertEquals(logger, cfg.getLogger()); + } + + @Test + public void testException() { + RetCodeException retCodeException = new RetCodeException(42, "", ""); + Assert.assertEquals(new Integer(42), retCodeException.getRetCode()); + Assert.assertEquals("", retCodeException.getRequestId()); + + ValidatorException validatorException = new ValidatorException(""); + try { + throw validatorException; + } catch (ValidatorException e) { + Assert.assertEquals(validatorException, e); + } + } +} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/RequestTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/RequestTest.java new file mode 100644 index 00000000..e9f9f097 --- /dev/null +++ b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/accessor/RequestTest.java @@ -0,0 +1,181 @@ +package cn.ucloud.common.accessor; + +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.*; + +class DemoRequest extends Request { + + @UCloudParam("Name") + private String name; + + @UCloudParam("CPU") + private Integer cpu; + + @UCloudParam("Size") + private Double size; + + @UCloudParam("UHostIds") + private List uhostIds; + + @UCloudParam("Led") + private Led led; + + @UCloudParam("NetworkInterface") + private List networkInterface; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getCpu() { + return cpu; + } + + public void setCpu(Integer cpu) { + this.cpu = cpu; + } + + public Double getSize() { + return size; + } + + public void setSize(Double size) { + this.size = size; + } + + public List getUhostIds() { + return uhostIds; + } + + public void setUhostIds(List uhostIds) { + this.uhostIds = uhostIds; + } + + public Led getLed() { + return led; + } + + public void setLed(Led led) { + this.led = led; + } + + public List getNetworkInterface() { + return networkInterface; + } + + public void setNetworkInterface(List networkInterface) { + this.networkInterface = networkInterface; + } + + static class Led extends Request { + + @UCloudParam("Enabled") + private Boolean enabled; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + } + + static class NetworkInterface extends Request { + + @UCloudParam("Bandwidth") + private Integer bandwidth; + + public Integer getBandwidth() { + return bandwidth; + } + + public void setBandwidth(Integer bandwidth) { + this.bandwidth = bandwidth; + } + } + + DemoRequest() { + super(); + } +} + +class DemoResponse extends Response {} + +public class RequestTest { + + @Test + public void testRequest() { + DemoRequest request = new DemoRequest(); + + request.setName("foo"); + request.setCpu(1); + request.setSize(42.0); + request.setUhostIds(Arrays.asList("uhost-xxx", "uhost-yyy")); + + DemoRequest.Led led = new DemoRequest.Led(); + led.setEnabled(true); + request.setLed(led); + + DemoRequest.NetworkInterface ni = new DemoRequest.NetworkInterface(); + ni.setBandwidth(42); + request.setNetworkInterface(Collections.singletonList(ni)); + + request.setAction("Foo"); + request.setPublicKey("keyfoobar42=="); + request.setSignature("sig42=="); + Assert.assertEquals("Foo", request.getAction()); + Assert.assertEquals("keyfoobar42==", request.getPublicKey()); + Assert.assertEquals("sig42==", request.getSignature()); + + request.withMaxRetries(3); + request.withTimeout(30); + Assert.assertEquals(new Integer(30), request.loadTimeout()); + + Map expected = new HashMap<>(); + expected.put("Name", "foo"); + expected.put("Size", 42.0); + expected.put("Led.Enabled", true); + expected.put("CPU", 1); + expected.put("UHostIds.0", "uhost-xxx"); + expected.put("UHostIds.1", "uhost-yyy"); + expected.put("NetworkInterface.0.Bandwidth", 42); + expected.put("Action", "Foo"); + expected.put("PublicKey", "keyfoobar42=="); + expected.put("Signature", "sig42=="); + + try { + Map result = request.encode(); + Assert.assertEquals(expected, result); + } catch (Exception e) { + Assert.assertNull(e); + } + } + + @Test + public void testResponse() { + Response response = new Response(); + + response.setRequestId("xxxx-xxxx"); + Assert.assertEquals("xxxx-xxxx", response.getRequestId()); + + response.setRetCode(42); + Assert.assertEquals(new Integer(42), response.getRetCode()); + + response.setAction("foo"); + Assert.assertEquals("foo", response.getAction()); + + response.setMessage("..."); + Assert.assertEquals("...", response.getMessage()); + } +} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/ClientTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/ClientTest.java new file mode 100644 index 00000000..16415761 --- /dev/null +++ b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/ClientTest.java @@ -0,0 +1,100 @@ +package cn.ucloud.common.client; + +import static org.junit.Assert.assertEquals; + +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; +import cn.ucloud.common.response.Response; +import cn.ucloud.common.transport.DefaultTransport; + +import org.apache.http.*; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.junit.Test; +import org.mockito.Mockito; + +public class ClientTest { + + @Test + public void testCaseOK() { + Request request = new Request(); + request.setAction("GetRegion"); + + Response response = new Response(); + response.setRetCode(0); + this.testInvoke(request, response, null, false); + } + + @Test + public void testCaseNotFound() { + Request request = new Request(); + request.setAction("NotFound"); + + Response response = new Response(); + response.setRetCode(161); + this.testInvoke(request, response, null, true); + } + + @Test + public void testCaseException() { + Request request = new Request(); + request.setAction("GetRegion"); + + Response response = new Response(); + response.setRetCode(0); + this.testInvoke(request, response, new HttpException("some exception occurs") {}, true); + } + + // @Test + // public void testCaseRemote() { + // Request request = new Request(); + // request.setAction("GetRegion"); + // + // Response response = new Response(); + // response.setRetCode(0); + // this.testInvoke(request, null, null, false); + // } + + public void testInvoke( + Request request, Response response, Exception injectedException, Boolean hasException) { + Config config = new Config(); + config.setUserAgent("Demo/0.42"); + Credential credential = new Credential("foo", "bar"); + DefaultClient client = new DefaultClient(config, credential); + DefaultTransport transport = (DefaultTransport) client.getTransport(); + + if (injectedException != null) { + // inject exception into http client of transport + CloseableHttpClient httpClient = Mockito.mock(CloseableHttpClient.class); + try { + HttpPost httpPost = new HttpPost(); + Mockito.doThrow(injectedException).when(httpClient).execute(httpPost); + } catch (Exception e) { + e.printStackTrace(); + } + transport.setHttpClient(httpClient); + } else if (response != null) { + transport = Mockito.mock(DefaultTransport.class); + try { + Mockito.when(transport.invoke(request, response.getClass())).thenReturn(response); + } catch (UCloudException e) { + e.printStackTrace(); + } + } else { + response = new Response(); + } + + client.setTransport(transport); + + try { + client.invoke(request, response.getClass()); + } catch (UCloudException e) { + e.printStackTrace(); + assertEquals(true, hasException); + return; + } + assertEquals(false, hasException); + } +} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/DoActionTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/DoActionTest.java deleted file mode 100644 index 1b4c41df..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/DoActionTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.ucloud.common.client; - -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.model.GetProjectListParam; -import cn.ucloud.common.model.GetProjectListResult; -import cn.ucloud.common.model.GetRegionResult; -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.BaseResponseResult; -import cn.ucloud.common.pojo.UcloudConfig; -import org.junit.Before; -import org.junit.Test; - -/** - * @author: codezhang - * @date: 2019/10/31 11:16 上午 - * @describe: - **/ -public class DoActionTest { - - - private UcloudClient client; - - @Before - public void initData() { - client = new DefaultUcloudClient(new UcloudConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - } - - @Test - public void doAction() { - try { - GetProjectListResult getProjectListResult = (GetProjectListResult) client.doAction(new GetProjectListParam(), - GetProjectListResult.class); - JSONComparator.jsonComparator(getProjectListResult); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Test - public void doActionCallback() { - client.doAction(new GetProjectListParam(), GetProjectListResult.class, - new UcloudHandler() { - @Override - public Object success(GetRegionResult result) { - JSONComparator.jsonComparator(result); - return null; - } - - @Override - public Object failed(GetRegionResult result) { - JSONComparator.jsonComparator(result); - return null; - } - - @Override - public Object error(Exception e) { - e.printStackTrace(); - return null; - } - }); - } -} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetProjectListTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetProjectListTest.java deleted file mode 100755 index e6f5b3a9..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetProjectListTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.ucloud.common.client; - -import cn.ucloud.common.model.GetProjectListResult; -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.UcloudConfig; -import org.junit.Before; -import org.junit.Test; - -/** - * @description: - * @author: codezhang - * @date: 2018-11-13 15:29 - **/ -public class GetProjectListTest { - - private UcloudClient client; - - @Before - public void initData() { - client = new DefaultUcloudClient(new UcloudConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - } - - @Test - public void getProjectList() { - try { - GetProjectListResult getProjectListResult = client.getProjectList(); - JSONComparator.jsonComparator(getProjectListResult); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetRegionTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetRegionTest.java deleted file mode 100755 index 66392bb0..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/GetRegionTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.ucloud.common.client; - -import cn.ucloud.common.model.GetRegionResult; -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.UcloudConfig; -import org.junit.Before; -import org.junit.Test; - -import java.util.List; - -/** - * @description: - * @author: codezhang - * @date: 2018-11-13 14:06 - **/ -public class GetRegionTest { - private UcloudClient client; - - - @Before - public void initData() { - client = new DefaultUcloudClient(new UcloudConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - } - - @Test - public void getRegion() { - try { - GetRegionResult getRegionResult = client.getRegion(); - List regions = getRegionResult.getRegions(); - JSONComparator.jsonComparator(getRegionResult); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/JSONComparator.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/JSONComparator.java deleted file mode 100644 index 249ed91f..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/client/JSONComparator.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.ucloud.common.client; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-03-05 21:32 - **/ -public class JSONComparator { - - private static final Logger logger = LoggerFactory.getLogger(JSONComparator.class.getName()); - - public static void jsonComparator(BaseResponseResult result) { - try { - Gson gson = new GsonBuilder().serializeNulls().create(); - logger.info("result 2 json:{}", gson.toJson(result)); - JSONAssert.assertEquals(result.getResponseContent(), gson.toJson(result), JSONCompareMode.LENIENT); - } catch (Exception e) { - assertNull(e); - } - } - -} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/credential/CredentialTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/credential/CredentialTest.java new file mode 100644 index 00000000..91718401 --- /dev/null +++ b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/credential/CredentialTest.java @@ -0,0 +1,144 @@ +package cn.ucloud.common.credential; + +import static org.junit.Assert.*; + +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.common.request.Request; + +import org.junit.Assert; +import org.junit.Test; + +public class CredentialTest { + + private static final String pubKey = "ucloudsomeone@example.com1296235120854146120"; + private static final String priKey = "46f09bb9fab4f12dfc160dae12273d5332b5debe"; + + static class DemoRequest extends Request { + + DemoRequest() { + super(); + } + + @UCloudParam("Region") + private String region; + + @UCloudParam("Limit") + private Integer limit; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + } + + @Test + public void verifyAc() throws UCloudException { + Credential cred = new Credential(pubKey, priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + cred.setPublicKey(pubKey); + cred.setPrivateKey(priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + DemoRequest request = new DemoRequest(); + request.setAction("DescribeUHostInstance"); + request.setRegion("cn-bj2"); + request.setLimit(10); + + assertEquals("cba5cf5ec4d4233d206b1b54951e3787350a642f", cred.verifyAc(request)); + } + + static class DoubleRequest extends Request { + DoubleRequest() { + super(); + } + + @UCloudParam("Proportion") + private Double proportion; + + @UCloudParam("Region") + private String region; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public void setProportion(Double proportion) { + this.proportion = proportion; + } + + public Double getProportion() { + return proportion; + } + } + + @Test + public void verifyAcDoubleTailingZero() throws UCloudException { + Credential cred = new Credential(pubKey, priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + cred.setPublicKey(pubKey); + cred.setPrivateKey(priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + DoubleRequest request = new DoubleRequest(); + request.setAction("DescribeUHostInstance"); + request.setRegion("cn-bj2"); + request.setProportion(35.0); + + String ac0 = cred.verifyAc(request); + + // You can calculate sign by: + // ucloud sign --private-key 46f09bb9fab4f12dfc160dae12273d5332b5debe \ + // --param Action=DescribeUHostInstance --param Region=cn-bj2 \ + // --param Proportion=35 \ + // --param PublicKey=ucloudsomeone@example.com1296235120854146121 + assertEquals("da620b97de476947302291fc93a2d8b0710be328", ac0); + } + + @Test + public void verifyAcDoubleNoneTailingZero() throws UCloudException { + Credential cred = new Credential(pubKey, priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + cred.setPublicKey(pubKey); + cred.setPrivateKey(priKey); + Assert.assertEquals(pubKey, cred.getPublicKey()); + Assert.assertEquals(priKey, cred.getPrivateKey()); + + DoubleRequest request = new DoubleRequest(); + request.setAction("DescribeUHostInstance"); + request.setRegion("cn-bj2"); + request.setProportion(65.722); + + String ac0 = cred.verifyAc(request); + + // You can calculate sign by: + // ucloud sign --private-key 46f09bb9fab4f12dfc160dae12273d5332b5debe \ + // --param Action=DescribeUHostInstance --param Region=cn-bj2 \ + // --param Proportion=65.722 \ + // --param PublicKey=ucloudsomeone@example.com1296235120854146121 + assertEquals("5e39dd48144d6a075328e56a6c5e9df6c39ae939", ac0); + } +} diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ObjectToParamTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ObjectToParamTest.java deleted file mode 100755 index e23dc3aa..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ObjectToParamTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; -import cn.ucloud.common.util.ObjectToParam; -import org.junit.Test; - -import java.util.List; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-13 14:55 - **/ -public class ObjectToParamTest { - - private class Person extends BaseRequestParam { - @UcloudParam("Name") - private String name = "jianhui.zhang"; - - @UcloudParam("Com") - //@NotNull(message = "com can not be enpty") - private String com ; - - - private Integer age ; - - protected Person() { - super(""); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCom() { - return com; - } - - public void setCom(String com) { - this.com = com; - } - - public Integer getAge() { - return age; - } - - public void setAge(Integer age) { - this.age = age; - } - } - - @Test - public void objectToParams() throws Exception { - List params = ObjectToParam.objectToParams(new Person()); - for (Param param: - params) { - System.out.println(param.getParamKey()+"===>"+param.getParamValue()); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ParamValidatorTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ParamValidatorTest.java deleted file mode 100755 index e53a1215..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ParamValidatorTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.util.ParamValidator; -import org.junit.Test; - -import javax.validation.constraints.NotEmpty; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-13 11:29 - **/ -public class ParamValidatorTest { - - private class Person{ - @NotEmpty(message = "name can not be empty") - private String name; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - } - - - @Test - public void validator() { - Person person = new Person(); - person.setName("zhangsan"); - try { - ParamValidator.validator(person); - }catch (Exception e){ - System.out.println(e.fillInStackTrace()); - } - try { - System.out.println(new Person().getName()); - ParamValidator.validator(new Person()); - }catch (Exception e){ - System.out.println(e.fillInStackTrace()); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java b/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java deleted file mode 100755 index 9fc5d500..00000000 --- a/ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package cn.ucloud.common.util; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.Param; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - -/** - * @description: - * @author: codezhang - * @date: 2018-09-12 22:22 - **/ -public class SignatureTest { - - private Account account; - - @Before - public void initGlobalAccount(){ - account = new Account("46f09bb9fab4f12dfc160dae12273d5332b5debe", - "ucloudsomeone@example.com1296235120854146120"); - } - - public Param[] initParamsArray() { - Param[] params = { - new Param("Action", "CreateUHostInstance"), - new Param("Region", "cn-bj2"), - new Param("Zone", "cn-bj2-04"), - new Param("ImageId", "f43736e1-65a5-4bea-ad2e-8a46e18883c2"), - new Param("CPU", 2), - new Param("Memory", 2048), - new Param("DiskSpace", 10), - new Param("LoginMode", "Password"), - new Param("Password", "aaaa"), - new Param("Name", "Host01"), - new Param("ChargeType", "Month"), - new Param("Quantity", 1), - new Param("PublicKey", account.getPublicKey()),}; - return params; - } - - public List initParamsList() { - List params = new ArrayList<>(); - params.add(new Param("Action", "CreateUHostInstance")); - params.add(new Param("Region", "cn-bj2")); - params.add(new Param("Zone", "cn-bj2-04")); - params.add(new Param("ImageId", "f43736e1-65a5-4bea-ad2e-8a46e18883c2")); - params.add(new Param("CPU", 2)); - params.add(new Param("Memory", 2048)); - params.add(new Param("DiskSpace", 10)); - params.add(new Param("LoginMode", "Password")); - params.add(new Param("Password", "aaa")); - params.add(new Param("Name", "Host01")); - params.add(new Param("ChargeType", "Month")); - params.add(new Param("Quantity", 1)); - params.add(new Param("PublicKey", account.getPublicKey())); - return params; - } - - @Test - public void getSignatureArray() { - Param[] params = initParamsArray(); - System.out.println(Signature.getSignature(params,account)); - } - @Test - public void getSignatureLsit() { - List list = new ArrayList<>(initParamsList()); - System.out.println(Signature.getSignature(list,account)); - } - - - @Test - public void getParamArrayAfterSignature() { - Param[] params = initParamsArray(); - Param[] paramAfterSignature = Signature.getParamAfterSignature(params,account); - int len = paramAfterSignature.length; - for (int i =0 ;i params = initParamsList(); - params = Signature.getParamAfterSignature(params,account); - for (Param param:params){ - System.out.println(param.getParamKey()+"==="+param.getParamValue()); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-cube/pom.xml b/ucloud-sdk-java-cube/pom.xml new file mode 100644 index 00000000..112997cf --- /dev/null +++ b/ucloud-sdk-java-cube/pom.xml @@ -0,0 +1,49 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-java-cube + ucloud-sdk-java + 1.2.51-release + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + + com.google.code.gson + gson + + + + commons-codec + commons-codec + + + org.apache.commons + commons-lang3 + + + + junit + junit + test + + + + org.slf4j + slf4j-simple + provided + + + diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClient.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClient.java new file mode 100644 index 00000000..ff378698 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClient.java @@ -0,0 +1,179 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.client; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.cube.models.CreateCubeDeploymentRequest; +import cn.ucloud.cube.models.CreateCubeDeploymentResponse; +import cn.ucloud.cube.models.CreateCubePodRequest; +import cn.ucloud.cube.models.CreateCubePodResponse; +import cn.ucloud.cube.models.DeleteCubeDeploymentRequest; +import cn.ucloud.cube.models.DeleteCubeDeploymentResponse; +import cn.ucloud.cube.models.DeleteCubePodRequest; +import cn.ucloud.cube.models.DeleteCubePodResponse; +import cn.ucloud.cube.models.GetCubeDeploymentRequest; +import cn.ucloud.cube.models.GetCubeDeploymentResponse; +import cn.ucloud.cube.models.GetCubeExecTokenRequest; +import cn.ucloud.cube.models.GetCubeExecTokenResponse; +import cn.ucloud.cube.models.GetCubeExtendInfoRequest; +import cn.ucloud.cube.models.GetCubeExtendInfoResponse; +import cn.ucloud.cube.models.GetCubeMetricsRequest; +import cn.ucloud.cube.models.GetCubeMetricsResponse; +import cn.ucloud.cube.models.GetCubeTokenRequest; +import cn.ucloud.cube.models.GetCubeTokenResponse; +import cn.ucloud.cube.models.ListCubePodRequest; +import cn.ucloud.cube.models.ListCubePodResponse; +import cn.ucloud.cube.models.RenewCubePodRequest; +import cn.ucloud.cube.models.RenewCubePodResponse; + +/** This client is used to call actions of **Cube** service */ +public class CubeClient extends DefaultClient implements CubeClientInterface { + public CubeClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * CreateCubeDeployment - 创建容器实例Deployment + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateCubeDeploymentResponse createCubeDeployment(CreateCubeDeploymentRequest request) + throws UCloudException { + request.setAction("CreateCubeDeployment"); + return (CreateCubeDeploymentResponse) + this.invoke(request, CreateCubeDeploymentResponse.class); + } + + /** + * CreateCubePod - 创建容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateCubePodResponse createCubePod(CreateCubePodRequest request) + throws UCloudException { + request.setAction("CreateCubePod"); + return (CreateCubePodResponse) this.invoke(request, CreateCubePodResponse.class); + } + + /** + * DeleteCubeDeployment - 删除容器实例Deployment + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteCubeDeploymentResponse deleteCubeDeployment(DeleteCubeDeploymentRequest request) + throws UCloudException { + request.setAction("DeleteCubeDeployment"); + return (DeleteCubeDeploymentResponse) + this.invoke(request, DeleteCubeDeploymentResponse.class); + } + + /** + * DeleteCubePod - 删除容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteCubePodResponse deleteCubePod(DeleteCubePodRequest request) + throws UCloudException { + request.setAction("DeleteCubePod"); + return (DeleteCubePodResponse) this.invoke(request, DeleteCubePodResponse.class); + } + + /** + * GetCubeDeployment - 获取容器实例Deployment详细信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeDeploymentResponse getCubeDeployment(GetCubeDeploymentRequest request) + throws UCloudException { + request.setAction("GetCubeDeployment"); + return (GetCubeDeploymentResponse) this.invoke(request, GetCubeDeploymentResponse.class); + } + + /** + * GetCubeExecToken - 获取容器实例执行token + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeExecTokenResponse getCubeExecToken(GetCubeExecTokenRequest request) + throws UCloudException { + request.setAction("GetCubeExecToken"); + return (GetCubeExecTokenResponse) this.invoke(request, GetCubeExecTokenResponse.class); + } + + /** + * GetCubeExtendInfo - 获取容器实例附加信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeExtendInfoResponse getCubeExtendInfo(GetCubeExtendInfoRequest request) + throws UCloudException { + request.setAction("GetCubeExtendInfo"); + return (GetCubeExtendInfoResponse) this.invoke(request, GetCubeExtendInfoResponse.class); + } + + /** + * GetCubeMetrics - 获取容器实例指标 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeMetricsResponse getCubeMetrics(GetCubeMetricsRequest request) + throws UCloudException { + request.setAction("GetCubeMetrics"); + return (GetCubeMetricsResponse) this.invoke(request, GetCubeMetricsResponse.class); + } + + /** + * GetCubeToken - 获取容器实例Token + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeTokenResponse getCubeToken(GetCubeTokenRequest request) throws UCloudException { + request.setAction("GetCubeToken"); + return (GetCubeTokenResponse) this.invoke(request, GetCubeTokenResponse.class); + } + + /** + * ListCubePod - 获取容器实例详细列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListCubePodResponse listCubePod(ListCubePodRequest request) throws UCloudException { + request.setAction("ListCubePod"); + return (ListCubePodResponse) this.invoke(request, ListCubePodResponse.class); + } + + /** + * RenewCubePod - 更新容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public RenewCubePodResponse renewCubePod(RenewCubePodRequest request) throws UCloudException { + request.setAction("RenewCubePod"); + return (RenewCubePodResponse) this.invoke(request, RenewCubePodResponse.class); + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClientInterface.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClientInterface.java new file mode 100644 index 00000000..6a826df8 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/client/CubeClientInterface.java @@ -0,0 +1,137 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.client; + +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.cube.models.CreateCubeDeploymentRequest; +import cn.ucloud.cube.models.CreateCubeDeploymentResponse; +import cn.ucloud.cube.models.CreateCubePodRequest; +import cn.ucloud.cube.models.CreateCubePodResponse; +import cn.ucloud.cube.models.DeleteCubeDeploymentRequest; +import cn.ucloud.cube.models.DeleteCubeDeploymentResponse; +import cn.ucloud.cube.models.DeleteCubePodRequest; +import cn.ucloud.cube.models.DeleteCubePodResponse; +import cn.ucloud.cube.models.GetCubeDeploymentRequest; +import cn.ucloud.cube.models.GetCubeDeploymentResponse; +import cn.ucloud.cube.models.GetCubeExecTokenRequest; +import cn.ucloud.cube.models.GetCubeExecTokenResponse; +import cn.ucloud.cube.models.GetCubeExtendInfoRequest; +import cn.ucloud.cube.models.GetCubeExtendInfoResponse; +import cn.ucloud.cube.models.GetCubeMetricsRequest; +import cn.ucloud.cube.models.GetCubeMetricsResponse; +import cn.ucloud.cube.models.GetCubeTokenRequest; +import cn.ucloud.cube.models.GetCubeTokenResponse; +import cn.ucloud.cube.models.ListCubePodRequest; +import cn.ucloud.cube.models.ListCubePodResponse; +import cn.ucloud.cube.models.RenewCubePodRequest; +import cn.ucloud.cube.models.RenewCubePodResponse; + +/** This client is used to call actions of **Cube** service */ +public interface CubeClientInterface extends Client { + + /** + * CreateCubeDeployment - 创建容器实例Deployment + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateCubeDeploymentResponse createCubeDeployment(CreateCubeDeploymentRequest request) + throws UCloudException; + + /** + * CreateCubePod - 创建容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateCubePodResponse createCubePod(CreateCubePodRequest request) throws UCloudException; + + /** + * DeleteCubeDeployment - 删除容器实例Deployment + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteCubeDeploymentResponse deleteCubeDeployment(DeleteCubeDeploymentRequest request) + throws UCloudException; + + /** + * DeleteCubePod - 删除容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteCubePodResponse deleteCubePod(DeleteCubePodRequest request) throws UCloudException; + + /** + * GetCubeDeployment - 获取容器实例Deployment详细信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeDeploymentResponse getCubeDeployment(GetCubeDeploymentRequest request) + throws UCloudException; + + /** + * GetCubeExecToken - 获取容器实例执行token + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeExecTokenResponse getCubeExecToken(GetCubeExecTokenRequest request) + throws UCloudException; + + /** + * GetCubeExtendInfo - 获取容器实例附加信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeExtendInfoResponse getCubeExtendInfo(GetCubeExtendInfoRequest request) + throws UCloudException; + + /** + * GetCubeMetrics - 获取容器实例指标 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeMetricsResponse getCubeMetrics(GetCubeMetricsRequest request) + throws UCloudException; + + /** + * GetCubeToken - 获取容器实例Token + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetCubeTokenResponse getCubeToken(GetCubeTokenRequest request) throws UCloudException; + + /** + * ListCubePod - 获取容器实例详细列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListCubePodResponse listCubePod(ListCubePodRequest request) throws UCloudException; + + /** + * RenewCubePod - 更新容器实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public RenewCubePodResponse renewCubePod(RenewCubePodRequest request) throws UCloudException; +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentRequest.java new file mode 100644 index 00000000..245f61d6 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentRequest.java @@ -0,0 +1,162 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateCubeDeploymentRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** Deployment所属VPC */ + @NotEmpty + @UCloudParam("VPCId") + private String vpcId; + + /** Deployment所属子网 */ + @NotEmpty + @UCloudParam("SubnetId") + private String subnetId; + + /** Deployment yaml,使用base64编码 */ + @NotEmpty + @UCloudParam("Deployment") + private String deployment; + + /** Deployment名称 */ + @UCloudParam("Name") + private String name; + + /** CPU平台 */ + @UCloudParam("CpuPlatform") + private String cpuPlatform; + + /** 计费模式 */ + @UCloudParam("ChargeType") + private String chargeType; + + /** 数量,默认为1 */ + @UCloudParam("Quantity") + private String quantity; + + /** 标签 */ + @UCloudParam("Tag") + private String tag; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getDeployment() { + return deployment; + } + + public void setDeployment(String deployment) { + this.deployment = deployment; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCpuPlatform() { + return cpuPlatform; + } + + public void setCpuPlatform(String cpuPlatform) { + this.cpuPlatform = cpuPlatform; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentResponse.java new file mode 100644 index 00000000..20a6c139 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubeDeploymentResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateCubeDeploymentResponse extends Response { + + /** Deployment ID */ + @SerializedName("DeploymentId") + private String deploymentId; + + /** Deployment yaml,使用base64编码 */ + @SerializedName("Deployment") + private String deployment; + + public String getDeploymentId() { + return deploymentId; + } + + public void setDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + } + + public String getDeployment() { + return deployment; + } + + public void setDeployment(String deployment) { + this.deployment = deployment; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodRequest.java new file mode 100644 index 00000000..2dc40d26 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodRequest.java @@ -0,0 +1,102 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateCubePodRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 容器实例所属的VPC ID */ + @NotEmpty + @UCloudParam("VPCId") + private String vpcId; + + /** 容器实例所属的子网ID */ + @NotEmpty + @UCloudParam("SubnetId") + private String subnetId; + + /** Pod yaml,使用base64编码 */ + @NotEmpty + @UCloudParam("Pod") + private String pod; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getPod() { + return pod; + } + + public void setPod(String pod) { + this.pod = pod; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodResponse.java new file mode 100644 index 00000000..965b3a46 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/CreateCubePodResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateCubePodResponse extends Response { + + /** Pod yaml,使用base64编码 */ + @SerializedName("Pod") + private String pod; + + /** 容器实例ID */ + @SerializedName("CubeId") + private String cubeId; + + public String getPod() { + return pod; + } + + public void setPod(String pod) { + this.pod = pod; + } + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentRequest.java new file mode 100644 index 00000000..765e4cf7 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentRequest.java @@ -0,0 +1,50 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteCubeDeploymentRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentResponse.java new file mode 100644 index 00000000..e89b0858 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubeDeploymentResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteCubeDeploymentResponse extends Response {} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodRequest.java new file mode 100644 index 00000000..cfd36b67 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodRequest.java @@ -0,0 +1,99 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteCubePodRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 要删除的容器实例UID,若填写了CubeId则可忽略 */ + @UCloudParam("Uid") + private String uid; + + /** 要删除的容器实例ID,若填写了Uid则可忽略 */ + @UCloudParam("CubeId") + private String cubeId; + + /** 要释放的EIP,如果容器实例绑定了EIP则可以填写,会将EIP一并释放。否则EIP会被保留。 */ + @UCloudParam("ReleaseEIP") + private String releaseEIP; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } + + public String getReleaseEIP() { + return releaseEIP; + } + + public void setReleaseEIP(String releaseEIP) { + this.releaseEIP = releaseEIP; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodResponse.java new file mode 100644 index 00000000..b1cd31ae --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/DeleteCubePodResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteCubePodResponse extends Response {} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentRequest.java new file mode 100644 index 00000000..82042000 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentRequest.java @@ -0,0 +1,76 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetCubeDeploymentRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** Deployment ID */ + @NotEmpty + @UCloudParam("DeploymentId") + private String deploymentId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getDeploymentId() { + return deploymentId; + } + + public void setDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentResponse.java new file mode 100644 index 00000000..09427c85 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeDeploymentResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class GetCubeDeploymentResponse extends Response { + + /** Deployment yaml,使用base64编码 */ + @SerializedName("Deployment") + private String deployment; + + public String getDeployment() { + return deployment; + } + + public void setDeployment(String deployment) { + this.deployment = deployment; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenRequest.java new file mode 100644 index 00000000..58f7a03f --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenRequest.java @@ -0,0 +1,100 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetCubeExecTokenRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 要执行的容器名称 */ + @NotEmpty + @UCloudParam("ContainerName") + private String containerName; + + /** 容器实例ID,若填写了Uid则可忽略 */ + @UCloudParam("CubeId") + private String cubeId; + + /** 容器实例UID,若填写了CubeId则可忽略 */ + @UCloudParam("Uid") + private String uid; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getContainerName() { + return containerName; + } + + public void setContainerName(String containerName) { + this.containerName = containerName; + } + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenResponse.java new file mode 100644 index 00000000..85d4f31a --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExecTokenResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class GetCubeExecTokenResponse extends Response { + + /** 执行Token */ + @SerializedName("Token") + private String token; + + /** 终端url */ + @SerializedName("TerminalUrl") + private String terminalUrl; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getTerminalUrl() { + return terminalUrl; + } + + public void setTerminalUrl(String terminalUrl) { + this.terminalUrl = terminalUrl; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoRequest.java new file mode 100644 index 00000000..2b40fede --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetCubeExtendInfoRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 容器实例ID,用逗号分割 */ + @UCloudParam("CubeIds") + private String cubeIds; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getCubeIds() { + return cubeIds; + } + + public void setCubeIds(String cubeIds) { + this.cubeIds = cubeIds; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoResponse.java new file mode 100644 index 00000000..8edd6571 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeExtendInfoResponse.java @@ -0,0 +1,236 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GetCubeExtendInfoResponse extends Response { + + /** 容器实例的附加信息 */ + @SerializedName("ExtendInfo") + private List extendInfo; + + public List getExtendInfo() { + return extendInfo; + } + + public void setExtendInfo(List extendInfo) { + this.extendInfo = extendInfo; + } + + public static class CubeExtendInfo extends Response { + + /** Cube的Id */ + @SerializedName("CubeId") + private String cubeId; + + /** Cube的名称 */ + @SerializedName("Name") + private String name; + + /** EIPSet */ + @SerializedName("Eip") + private List eip; + + /** 资源有效期 */ + @SerializedName("Expiration") + private Integer expiration; + + /** 业务组名称 */ + @SerializedName("Tag") + private String tag; + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getEip() { + return eip; + } + + public void setEip(List eip) { + this.eip = eip; + } + + public Integer getExpiration() { + return expiration; + } + + public void setExpiration(Integer expiration) { + this.expiration = expiration; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + } + + public static class EIPAddr extends Response { + + /** IP地址 */ + @SerializedName("IP") + private String ip; + + /** 线路名称BGP或者internalation */ + @SerializedName("OperatorName") + private String operatorName; + + public String getIP() { + return ip; + } + + public void setIP(String ip) { + this.ip = ip; + } + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + } + + public static class EIPSet extends Response { + + /** EIP带宽值 */ + @SerializedName("Bandwidth") + private Integer bandwidth; + + /** 带宽类型0标准普通带宽,1表示共享带宽 */ + @SerializedName("BandwidthType") + private Integer bandwidthType; + + /** EIP创建时间 */ + @SerializedName("CreateTime") + private Integer createTime; + + /** EIP地址 */ + @SerializedName("EIPAddr") + private List eipAddr; + + /** EIPId */ + @SerializedName("EIPId") + private String eipId; + + /** 付费模式,带宽付费或者流量付费 */ + @SerializedName("PayMode") + private String payMode; + + /** EIP绑定对象的资源Id */ + @SerializedName("Resource") + private String resource; + + /** EIP状态,表示使用中或者空闲 */ + @SerializedName("Status") + private String status; + + /** EIP权重 */ + @SerializedName("Weight") + private Integer weight; + + public Integer getBandwidth() { + return bandwidth; + } + + public void setBandwidth(Integer bandwidth) { + this.bandwidth = bandwidth; + } + + public Integer getBandwidthType() { + return bandwidthType; + } + + public void setBandwidthType(Integer bandwidthType) { + this.bandwidthType = bandwidthType; + } + + public Integer getCreateTime() { + return createTime; + } + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public List getEIPAddr() { + return eipAddr; + } + + public void setEIPAddr(List eipAddr) { + this.eipAddr = eipAddr; + } + + public String getEIPId() { + return eipId; + } + + public void setEIPId(String eipId) { + this.eipId = eipId; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsRequest.java new file mode 100644 index 00000000..40906f34 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsRequest.java @@ -0,0 +1,128 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetCubeMetricsRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 资源ID */ + @NotEmpty + @UCloudParam("ResourceId") + private String resourceId; + + /** 指标名称 */ + @NotEmpty + @UCloudParam("MetricName") + private String metricName; + + /** 容器名称 */ + @NotEmpty + @UCloudParam("ContainerName") + private String containerName; + + /** 开始时间 */ + @NotEmpty + @UCloudParam("BeginTime") + private String beginTime; + + /** 结束时间 */ + @NotEmpty + @UCloudParam("EndTime") + private String endTime; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + this.metricName = metricName; + } + + public String getContainerName() { + return containerName; + } + + public void setContainerName(String containerName) { + this.containerName = containerName; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsResponse.java new file mode 100644 index 00000000..51ae0893 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeMetricsResponse.java @@ -0,0 +1,89 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GetCubeMetricsResponse extends Response { + + /** 指标数据 */ + @SerializedName("DataSets") + private List dataSets; + + public List getDataSets() { + return dataSets; + } + + public void setDataSets(List dataSets) { + this.dataSets = dataSets; + } + + public static class MetricDataSet extends Response { + + /** */ + @SerializedName("MetricName") + private String metricName; + + /** */ + @SerializedName("Values") + private List values; + + public String getMetricName() { + return metricName; + } + + public void setMetricName(String metricName) { + this.metricName = metricName; + } + + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + } + + public static class ValueSet extends Response { + + /** */ + @SerializedName("Value") + private Double value; + + /** */ + @SerializedName("Timestamp") + private Integer timestamp; + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + + public Integer getTimestamp() { + return timestamp; + } + + public void setTimestamp(Integer timestamp) { + this.timestamp = timestamp; + } + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenRequest.java new file mode 100644 index 00000000..a261fe11 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenRequest.java @@ -0,0 +1,100 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetCubeTokenRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 容器名称 */ + @NotEmpty + @UCloudParam("ContainerName") + private String containerName; + + /** 容器实例ID,若填写了Uid则可忽略 */ + @UCloudParam("CubeId") + private String cubeId; + + /** 容器实例UID,若填写了CubeId则可忽略 */ + @UCloudParam("Uid") + private String uid; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getContainerName() { + return containerName; + } + + public void setContainerName(String containerName) { + this.containerName = containerName; + } + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenResponse.java new file mode 100644 index 00000000..2d488fe2 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/GetCubeTokenResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class GetCubeTokenResponse extends Response { + + /** 容器实例Token */ + @SerializedName("Token") + private String token; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodRequest.java new file mode 100644 index 00000000..77f038b8 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodRequest.java @@ -0,0 +1,135 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class ListCubePodRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 列表起始位置偏移量,默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 返回数据长度,默认为20,最大100 */ + @UCloudParam("Limit") + private Integer limit; + + /** 容器实例组 */ + @UCloudParam("Group") + private String group; + + /** 容器实例所属VPC */ + @UCloudParam("VPCId") + private String vpcId; + + /** 容器实例所属子网 */ + @UCloudParam("SubnetId") + private String subnetId; + + /** 容器实例所属Deployment */ + @UCloudParam("DeploymentId") + private String deploymentId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getDeploymentId() { + return deploymentId; + } + + public void setDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodResponse.java new file mode 100644 index 00000000..d72118cf --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/ListCubePodResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListCubePodResponse extends Response { + + /** 容器实例yaml列表,以base64编码 */ + @SerializedName("Pods") + private List pods; + + /** 容器实例总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + public List getPods() { + return pods; + } + + public void setPods(List pods) { + this.pods = pods; + } + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodRequest.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodRequest.java new file mode 100644 index 00000000..5e957f0b --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class RenewCubePodRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Zone") + private String zone; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** Pod yaml,以base64编码 */ + @NotEmpty + @UCloudParam("Pod") + private String pod; + + /** 要更新的容器实例ID */ + @UCloudParam("CubeId") + private String cubeId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getPod() { + return pod; + } + + public void setPod(String pod) { + this.pod = pod; + } + + public String getCubeId() { + return cubeId; + } + + public void setCubeId(String cubeId) { + this.cubeId = cubeId; + } +} diff --git a/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodResponse.java b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodResponse.java new file mode 100644 index 00000000..948f4543 --- /dev/null +++ b/ucloud-sdk-java-cube/src/main/java/cn/ucloud/cube/models/RenewCubePodResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.cube.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class RenewCubePodResponse extends Response { + + /** Pod yaml,以base64编码 */ + @SerializedName("Pod") + private String pod; + + public String getPod() { + return pod; + } + + public void setPod(String pod) { + this.pod = pod; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/pom.xml b/ucloud-sdk-java-ipsecvpn/pom.xml new file mode 100644 index 00000000..729156e7 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/pom.xml @@ -0,0 +1,49 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-java-ipsecvpn + ucloud-sdk-java + 1.2.51-release + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + + com.google.code.gson + gson + + + + commons-codec + commons-codec + + + org.apache.commons + commons-lang3 + + + + junit + junit + test + + + + org.slf4j + slf4j-simple + provided + + + diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClient.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClient.java new file mode 100644 index 00000000..e7dd080e --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClient.java @@ -0,0 +1,213 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.client; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.ipsecvpn.models.CreateRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.CreateRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.CreateVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.CreateVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.CreateVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.CreateVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.DeleteRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DeleteRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DeleteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DeleteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DeleteVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.DeleteVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.DescribeRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DescribeRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DescribeVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DescribeVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DescribeVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.DescribeVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayPriceRequest; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayPriceResponse; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayUpgradePriceRequest; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayUpgradePriceResponse; +import cn.ucloud.ipsecvpn.models.UpdateVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.UpdateVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.UpdateVPNTunnelAttributeRequest; +import cn.ucloud.ipsecvpn.models.UpdateVPNTunnelAttributeResponse; + +/** This client is used to call actions of **IPSecVPN** service */ +public class IPSecVPNClient extends DefaultClient implements IPSecVPNClientInterface { + public IPSecVPNClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * CreateRemoteVPNGateway - 创建客户VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateRemoteVPNGatewayResponse createRemoteVPNGateway( + CreateRemoteVPNGatewayRequest request) throws UCloudException { + request.setAction("CreateRemoteVPNGateway"); + return (CreateRemoteVPNGatewayResponse) + this.invoke(request, CreateRemoteVPNGatewayResponse.class); + } + + /** + * CreateVPNGateway - 创建VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateVPNGatewayResponse createVPNGateway(CreateVPNGatewayRequest request) + throws UCloudException { + request.setAction("CreateVPNGateway"); + return (CreateVPNGatewayResponse) this.invoke(request, CreateVPNGatewayResponse.class); + } + + /** + * CreateVPNTunnel - 创建VPN隧道 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateVPNTunnelResponse createVPNTunnel(CreateVPNTunnelRequest request) + throws UCloudException { + request.setAction("CreateVPNTunnel"); + return (CreateVPNTunnelResponse) this.invoke(request, CreateVPNTunnelResponse.class); + } + + /** + * DeleteRemoteVPNGateway - 删除客户VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteRemoteVPNGatewayResponse deleteRemoteVPNGateway( + DeleteRemoteVPNGatewayRequest request) throws UCloudException { + request.setAction("DeleteRemoteVPNGateway"); + return (DeleteRemoteVPNGatewayResponse) + this.invoke(request, DeleteRemoteVPNGatewayResponse.class); + } + + /** + * DeleteVPNGateway - 删除VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteVPNGatewayResponse deleteVPNGateway(DeleteVPNGatewayRequest request) + throws UCloudException { + request.setAction("DeleteVPNGateway"); + return (DeleteVPNGatewayResponse) this.invoke(request, DeleteVPNGatewayResponse.class); + } + + /** + * DeleteVPNTunnel - 删除VPN隧道 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteVPNTunnelResponse deleteVPNTunnel(DeleteVPNTunnelRequest request) + throws UCloudException { + request.setAction("DeleteVPNTunnel"); + return (DeleteVPNTunnelResponse) this.invoke(request, DeleteVPNTunnelResponse.class); + } + + /** + * DescribeRemoteVPNGateway - 获取客户VPN网关信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeRemoteVPNGatewayResponse describeRemoteVPNGateway( + DescribeRemoteVPNGatewayRequest request) throws UCloudException { + request.setAction("DescribeRemoteVPNGateway"); + return (DescribeRemoteVPNGatewayResponse) + this.invoke(request, DescribeRemoteVPNGatewayResponse.class); + } + + /** + * DescribeVPNGateway - 获取VPN网关信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeVPNGatewayResponse describeVPNGateway(DescribeVPNGatewayRequest request) + throws UCloudException { + request.setAction("DescribeVPNGateway"); + return (DescribeVPNGatewayResponse) this.invoke(request, DescribeVPNGatewayResponse.class); + } + + /** + * DescribeVPNTunnel - 获取VPN隧道信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeVPNTunnelResponse describeVPNTunnel(DescribeVPNTunnelRequest request) + throws UCloudException { + request.setAction("DescribeVPNTunnel"); + return (DescribeVPNTunnelResponse) this.invoke(request, DescribeVPNTunnelResponse.class); + } + + /** + * GetVPNGatewayPrice - 获取VPN价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetVPNGatewayPriceResponse getVPNGatewayPrice(GetVPNGatewayPriceRequest request) + throws UCloudException { + request.setAction("GetVPNGatewayPrice"); + return (GetVPNGatewayPriceResponse) this.invoke(request, GetVPNGatewayPriceResponse.class); + } + + /** + * GetVPNGatewayUpgradePrice - 获取VPN网关规格改动价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetVPNGatewayUpgradePriceResponse getVPNGatewayUpgradePrice( + GetVPNGatewayUpgradePriceRequest request) throws UCloudException { + request.setAction("GetVPNGatewayUpgradePrice"); + return (GetVPNGatewayUpgradePriceResponse) + this.invoke(request, GetVPNGatewayUpgradePriceResponse.class); + } + + /** + * UpdateVPNGateway - 更改VPN网关规格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateVPNGatewayResponse updateVPNGateway(UpdateVPNGatewayRequest request) + throws UCloudException { + request.setAction("UpdateVPNGateway"); + return (UpdateVPNGatewayResponse) this.invoke(request, UpdateVPNGatewayResponse.class); + } + + /** + * UpdateVPNTunnelAttribute - 更新VPN隧道属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateVPNTunnelAttributeResponse updateVPNTunnelAttribute( + UpdateVPNTunnelAttributeRequest request) throws UCloudException { + request.setAction("UpdateVPNTunnelAttribute"); + return (UpdateVPNTunnelAttributeResponse) + this.invoke(request, UpdateVPNTunnelAttributeResponse.class); + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClientInterface.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClientInterface.java new file mode 100644 index 00000000..6f5fd777 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/client/IPSecVPNClientInterface.java @@ -0,0 +1,164 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.client; + +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.ipsecvpn.models.CreateRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.CreateRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.CreateVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.CreateVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.CreateVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.CreateVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.DeleteRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DeleteRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DeleteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DeleteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DeleteVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.DeleteVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.DescribeRemoteVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DescribeRemoteVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DescribeVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.DescribeVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.DescribeVPNTunnelRequest; +import cn.ucloud.ipsecvpn.models.DescribeVPNTunnelResponse; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayPriceRequest; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayPriceResponse; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayUpgradePriceRequest; +import cn.ucloud.ipsecvpn.models.GetVPNGatewayUpgradePriceResponse; +import cn.ucloud.ipsecvpn.models.UpdateVPNGatewayRequest; +import cn.ucloud.ipsecvpn.models.UpdateVPNGatewayResponse; +import cn.ucloud.ipsecvpn.models.UpdateVPNTunnelAttributeRequest; +import cn.ucloud.ipsecvpn.models.UpdateVPNTunnelAttributeResponse; + +/** This client is used to call actions of **IPSecVPN** service */ +public interface IPSecVPNClientInterface extends Client { + + /** + * CreateRemoteVPNGateway - 创建客户VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateRemoteVPNGatewayResponse createRemoteVPNGateway( + CreateRemoteVPNGatewayRequest request) throws UCloudException; + + /** + * CreateVPNGateway - 创建VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateVPNGatewayResponse createVPNGateway(CreateVPNGatewayRequest request) + throws UCloudException; + + /** + * CreateVPNTunnel - 创建VPN隧道 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateVPNTunnelResponse createVPNTunnel(CreateVPNTunnelRequest request) + throws UCloudException; + + /** + * DeleteRemoteVPNGateway - 删除客户VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteRemoteVPNGatewayResponse deleteRemoteVPNGateway( + DeleteRemoteVPNGatewayRequest request) throws UCloudException; + + /** + * DeleteVPNGateway - 删除VPN网关 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteVPNGatewayResponse deleteVPNGateway(DeleteVPNGatewayRequest request) + throws UCloudException; + + /** + * DeleteVPNTunnel - 删除VPN隧道 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteVPNTunnelResponse deleteVPNTunnel(DeleteVPNTunnelRequest request) + throws UCloudException; + + /** + * DescribeRemoteVPNGateway - 获取客户VPN网关信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeRemoteVPNGatewayResponse describeRemoteVPNGateway( + DescribeRemoteVPNGatewayRequest request) throws UCloudException; + + /** + * DescribeVPNGateway - 获取VPN网关信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeVPNGatewayResponse describeVPNGateway(DescribeVPNGatewayRequest request) + throws UCloudException; + + /** + * DescribeVPNTunnel - 获取VPN隧道信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeVPNTunnelResponse describeVPNTunnel(DescribeVPNTunnelRequest request) + throws UCloudException; + + /** + * GetVPNGatewayPrice - 获取VPN价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetVPNGatewayPriceResponse getVPNGatewayPrice(GetVPNGatewayPriceRequest request) + throws UCloudException; + + /** + * GetVPNGatewayUpgradePrice - 获取VPN网关规格改动价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetVPNGatewayUpgradePriceResponse getVPNGatewayUpgradePrice( + GetVPNGatewayUpgradePriceRequest request) throws UCloudException; + + /** + * UpdateVPNGateway - 更改VPN网关规格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateVPNGatewayResponse updateVPNGateway(UpdateVPNGatewayRequest request) + throws UCloudException; + + /** + * UpdateVPNTunnelAttribute - 更新VPN隧道属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateVPNTunnelAttributeResponse updateVPNTunnelAttribute( + UpdateVPNTunnelAttributeRequest request) throws UCloudException; +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayRequest.java new file mode 100644 index 00000000..7290d7a9 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayRequest.java @@ -0,0 +1,98 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateRemoteVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 客户VPN网关名称 */ + @NotEmpty + @UCloudParam("RemoteVPNGatewayName") + private String remoteVPNGatewayName; + + /** 客户VPN网关地址 */ + @NotEmpty + @UCloudParam("RemoteVPNGatewayAddr") + private String remoteVPNGatewayAddr; + + /** 业务组名称,默认为 "Default" */ + @UCloudParam("Tag") + private String tag; + + /** 备注,默认为空 */ + @UCloudParam("Remark") + private String remark; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getRemoteVPNGatewayName() { + return remoteVPNGatewayName; + } + + public void setRemoteVPNGatewayName(String remoteVPNGatewayName) { + this.remoteVPNGatewayName = remoteVPNGatewayName; + } + + public String getRemoteVPNGatewayAddr() { + return remoteVPNGatewayAddr; + } + + public void setRemoteVPNGatewayAddr(String remoteVPNGatewayAddr) { + this.remoteVPNGatewayAddr = remoteVPNGatewayAddr; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayResponse.java new file mode 100644 index 00000000..a875a43d --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateRemoteVPNGatewayResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateRemoteVPNGatewayResponse extends Response { + + /** 新建客户VPN网关的资源ID */ + @SerializedName("RemoteVPNGatewayId") + private String remoteVPNGatewayId; + + public String getRemoteVPNGatewayId() { + return remoteVPNGatewayId; + } + + public void setRemoteVPNGatewayId(String remoteVPNGatewayId) { + this.remoteVPNGatewayId = remoteVPNGatewayId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayRequest.java new file mode 100644 index 00000000..3e47a113 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayRequest.java @@ -0,0 +1,171 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 新建VPN网关名称 */ + @NotEmpty + @UCloudParam("VPNGatewayName") + private String vpnGatewayName; + + /** 新建VPN网关所属VPC的资源ID */ + @NotEmpty + @UCloudParam("VPCId") + private String vpcId; + + /** 购买的VPN网关规格,枚举值为: Standard, 标准型; Enhanced, 增强型 */ + @NotEmpty + @UCloudParam("Grade") + private String grade; + + /** 备注,默认为空 */ + @UCloudParam("Remark") + private String remark; + + /** 业务组名称,默认为 "Default" */ + @UCloudParam("Tag") + private String tag; + + /** 购买时长, 默认: 1 */ + @UCloudParam("Quantity") + private Integer quantity; + + /** 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费;Dynamic, 按需付费(需开启权限);Trial, 试用(需开启权限);默认为按月付费 */ + @UCloudParam("ChargeType") + private String chargeType; + + /** 业务组ID */ + @UCloudParam("BusinessId") + private String businessId; + + /** 若要绑定EIP,在此填上EIP的资源ID */ + @UCloudParam("EIPId") + private String eipId; + + /** 代金券ID, 默认不使用 */ + @UCloudParam("CouponId") + private String couponId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNGatewayName() { + return vpnGatewayName; + } + + public void setVPNGatewayName(String vpnGatewayName) { + this.vpnGatewayName = vpnGatewayName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public String getBusinessId() { + return businessId; + } + + public void setBusinessId(String businessId) { + this.businessId = businessId; + } + + public String getEIPId() { + return eipId; + } + + public void setEIPId(String eipId) { + this.eipId = eipId; + } + + public String getCouponId() { + return couponId; + } + + public void setCouponId(String couponId) { + this.couponId = couponId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayResponse.java new file mode 100644 index 00000000..e1f40463 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNGatewayResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateVPNGatewayResponse extends Response { + + /** 新建VPN网关的资源ID */ + @SerializedName("VPNGatewayId") + private String vpnGatewayId; + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelRequest.java new file mode 100644 index 00000000..b9eabcbf --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelRequest.java @@ -0,0 +1,348 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class CreateVPNTunnelRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN隧道名称 */ + @NotEmpty + @UCloudParam("VPNTunnelName") + private String vpnTunnelName; + + /** VPN网关的资源ID */ + @NotEmpty + @UCloudParam("VPNGatewayId") + private String vpnGatewayId; + + /** 客户VPN网关的资源ID */ + @NotEmpty + @UCloudParam("RemoteVPNGatewayId") + private String remoteVPNGatewayId; + + /** 预共享密钥 */ + @NotEmpty + @UCloudParam("IKEPreSharedKey") + private String ikePreSharedKey; + + /** vpcId */ + @NotEmpty + @UCloudParam("VPCId") + private String vpcId; + + /** ike版本,枚举值: "IKE V1","IKE V2",默认v1 */ + @NotEmpty + @UCloudParam("IKEVersion") + private String ikeVersion; + + /** 指定VPN连接的本地子网的资源ID,最多可填写10个。 */ + @NotEmpty + @UCloudParam("IPSecLocalSubnetIds") + private List ipSecLocalSubnetIds; + + /** 指定VPN连接的客户网段,最多可填写20个。 */ + @NotEmpty + @UCloudParam("IPSecRemoteSubnets") + private List ipSecRemoteSubnets; + + /** 业务组,默认为“Default” */ + @UCloudParam("Tag") + private String tag; + + /** 备注,默认为空 */ + @UCloudParam("Remark") + private String remark; + + /** IKE协商过程中使用的加密算法,枚举值,"aes128", "aes192", "aes256", "aes512", "3des"。默认值为“aes128” */ + @UCloudParam("IKEEncryptionAlgorithm") + private String ikeEncryptionAlgorithm; + + /** IKE协商过程中使用的认证算法,"md5", "sha1", "sha2-256"。默认值为“sha1” */ + @UCloudParam("IKEAuthenticationAlgorithm") + private String ikeAuthenticationAlgorithm; + + /** IKE协商过程中使用的模式,枚举值,主模式,“main”;野蛮模式,“aggressive”。IKEV1默认为主模式“main”,IKEV2时不使用该参数。 */ + @UCloudParam("IKEExchangeMode") + private String ikeExchangeMode; + + /** 本端标识。枚举值,自动识别,“auto”;IP地址或域名。默认为自动识别“auto”。IKEV2必填该参数 */ + @UCloudParam("IKELocalId") + private String ikeLocalId; + + /** 客户端标识。枚举值,自动识别,“auto”;IP地址或域名。默认为“自动识别“auto”。IKEV2必填该参数 */ + @UCloudParam("IKERemoteId") + private String ikeRemoteId; + + /** IKE协商过程中使用的DH组,枚举值,"1", "2", "5", "14", "15", "16"。默认为“15” */ + @UCloudParam("IKEDhGroup") + private String ikeDhGroup; + + /** IKE中SA的生存时间,可填写范围为600-604800。默认为86400。 */ + @UCloudParam("IKESALifetime") + private String ikesaLifetime; + + /** 使用的安全协议,枚举值,“esp”,“ah”。默认为“esp” */ + @UCloudParam("IPSecProtocol") + private String ipSecProtocol; + + /** IPSec隧道中使用的加密算法,枚举值,"aes128", "aes192", "aes256", "aes512", "3des"。默认值为“aes128” */ + @UCloudParam("IPSecEncryptionAlgorithm") + private String ipSecEncryptionAlgorithm; + + /** IPSec隧道中使用的认证算法,枚举值,"md5", "sha1","sha2-256"。默认值为“sha1” */ + @UCloudParam("IPSecAuthenticationAlgorithm") + private String ipSecAuthenticationAlgorithm; + + /** IPSec中SA的生存时间,可填写范围为1200 - 604800。默认为3600 */ + @UCloudParam("IPSecSALifetime") + private String ipSecSALifetime; + + /** IPSec中SA的生存时间(以字节计)。可选为8000 – 20000000。默认使用SA生存时间, */ + @UCloudParam("IPSecSALifetimeBytes") + private String ipSecSALifetimeBytes; + + /** IPSec的PFS是否开启,枚举值,,不开启,"disable";数字表示DH组, "1", "2", "5", "14", "15", "16"。默认为“disable”。 */ + @UCloudParam("IPSecPFSDhGroup") + private String ipSecPFSDhGroup; + + /** IPSec隧道关闭后的处理动作,枚举值:“none”,流量触发;“restart”,自动重联,默认为none */ + @UCloudParam("IPSecCloseAction") + private String ipSecCloseAction; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNTunnelName() { + return vpnTunnelName; + } + + public void setVPNTunnelName(String vpnTunnelName) { + this.vpnTunnelName = vpnTunnelName; + } + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public String getRemoteVPNGatewayId() { + return remoteVPNGatewayId; + } + + public void setRemoteVPNGatewayId(String remoteVPNGatewayId) { + this.remoteVPNGatewayId = remoteVPNGatewayId; + } + + public String getIKEPreSharedKey() { + return ikePreSharedKey; + } + + public void setIKEPreSharedKey(String ikePreSharedKey) { + this.ikePreSharedKey = ikePreSharedKey; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getIKEVersion() { + return ikeVersion; + } + + public void setIKEVersion(String ikeVersion) { + this.ikeVersion = ikeVersion; + } + + public List getIPSecLocalSubnetIds() { + return ipSecLocalSubnetIds; + } + + public void setIPSecLocalSubnetIds(List ipSecLocalSubnetIds) { + this.ipSecLocalSubnetIds = ipSecLocalSubnetIds; + } + + public List getIPSecRemoteSubnets() { + return ipSecRemoteSubnets; + } + + public void setIPSecRemoteSubnets(List ipSecRemoteSubnets) { + this.ipSecRemoteSubnets = ipSecRemoteSubnets; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getIKEEncryptionAlgorithm() { + return ikeEncryptionAlgorithm; + } + + public void setIKEEncryptionAlgorithm(String ikeEncryptionAlgorithm) { + this.ikeEncryptionAlgorithm = ikeEncryptionAlgorithm; + } + + public String getIKEAuthenticationAlgorithm() { + return ikeAuthenticationAlgorithm; + } + + public void setIKEAuthenticationAlgorithm(String ikeAuthenticationAlgorithm) { + this.ikeAuthenticationAlgorithm = ikeAuthenticationAlgorithm; + } + + public String getIKEExchangeMode() { + return ikeExchangeMode; + } + + public void setIKEExchangeMode(String ikeExchangeMode) { + this.ikeExchangeMode = ikeExchangeMode; + } + + public String getIKELocalId() { + return ikeLocalId; + } + + public void setIKELocalId(String ikeLocalId) { + this.ikeLocalId = ikeLocalId; + } + + public String getIKERemoteId() { + return ikeRemoteId; + } + + public void setIKERemoteId(String ikeRemoteId) { + this.ikeRemoteId = ikeRemoteId; + } + + public String getIKEDhGroup() { + return ikeDhGroup; + } + + public void setIKEDhGroup(String ikeDhGroup) { + this.ikeDhGroup = ikeDhGroup; + } + + public String getIKESALifetime() { + return ikesaLifetime; + } + + public void setIKESALifetime(String ikesaLifetime) { + this.ikesaLifetime = ikesaLifetime; + } + + public String getIPSecProtocol() { + return ipSecProtocol; + } + + public void setIPSecProtocol(String ipSecProtocol) { + this.ipSecProtocol = ipSecProtocol; + } + + public String getIPSecEncryptionAlgorithm() { + return ipSecEncryptionAlgorithm; + } + + public void setIPSecEncryptionAlgorithm(String ipSecEncryptionAlgorithm) { + this.ipSecEncryptionAlgorithm = ipSecEncryptionAlgorithm; + } + + public String getIPSecAuthenticationAlgorithm() { + return ipSecAuthenticationAlgorithm; + } + + public void setIPSecAuthenticationAlgorithm(String ipSecAuthenticationAlgorithm) { + this.ipSecAuthenticationAlgorithm = ipSecAuthenticationAlgorithm; + } + + public String getIPSecSALifetime() { + return ipSecSALifetime; + } + + public void setIPSecSALifetime(String ipSecSALifetime) { + this.ipSecSALifetime = ipSecSALifetime; + } + + public String getIPSecSALifetimeBytes() { + return ipSecSALifetimeBytes; + } + + public void setIPSecSALifetimeBytes(String ipSecSALifetimeBytes) { + this.ipSecSALifetimeBytes = ipSecSALifetimeBytes; + } + + public String getIPSecPFSDhGroup() { + return ipSecPFSDhGroup; + } + + public void setIPSecPFSDhGroup(String ipSecPFSDhGroup) { + this.ipSecPFSDhGroup = ipSecPFSDhGroup; + } + + public String getIPSecCloseAction() { + return ipSecCloseAction; + } + + public void setIPSecCloseAction(String ipSecCloseAction) { + this.ipSecCloseAction = ipSecCloseAction; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelResponse.java new file mode 100644 index 00000000..6de9f42f --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/CreateVPNTunnelResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateVPNTunnelResponse extends Response { + + /** VPN隧道的资源ID */ + @SerializedName("VPNTunnelId") + private String vpnTunnelId; + + public String getVPNTunnelId() { + return vpnTunnelId; + } + + public void setVPNTunnelId(String vpnTunnelId) { + this.vpnTunnelId = vpnTunnelId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayRequest.java new file mode 100644 index 00000000..2de02b91 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteRemoteVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** 客户VPN网关的资源ID */ + @NotEmpty + @UCloudParam("RemoteVPNGatewayId") + private String remoteVPNGatewayId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getRemoteVPNGatewayId() { + return remoteVPNGatewayId; + } + + public void setRemoteVPNGatewayId(String remoteVPNGatewayId) { + this.remoteVPNGatewayId = remoteVPNGatewayId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayResponse.java new file mode 100644 index 00000000..f238a58a --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteRemoteVPNGatewayResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteRemoteVPNGatewayResponse extends Response {} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayRequest.java new file mode 100644 index 00000000..ad14ec3a --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayRequest.java @@ -0,0 +1,73 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN网关的资源ID */ + @NotEmpty + @UCloudParam("VPNGatewayId") + private String vpnGatewayId; + + /** 删除VPN时是否一并释放EIP。false,只解绑EIP不删除EIP;true,解绑并释放EIP。默认是false */ + @UCloudParam("ReleaseEip") + private Boolean releaseEip; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public Boolean getReleaseEip() { + return releaseEip; + } + + public void setReleaseEip(Boolean releaseEip) { + this.releaseEip = releaseEip; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayResponse.java new file mode 100644 index 00000000..f940df73 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNGatewayResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteVPNGatewayResponse extends Response {} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelRequest.java new file mode 100644 index 00000000..ae7d3e22 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelRequest.java @@ -0,0 +1,61 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteVPNTunnelRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN隧道的资源ID */ + @NotEmpty + @UCloudParam("VPNTunnelId") + private String vpnTunnelId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNTunnelId() { + return vpnTunnelId; + } + + public void setVPNTunnelId(String vpnTunnelId) { + this.vpnTunnelId = vpnTunnelId; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelResponse.java new file mode 100644 index 00000000..b4887276 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DeleteVPNTunnelResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteVPNTunnelResponse extends Response {} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayRequest.java new file mode 100644 index 00000000..16c97cf5 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayRequest.java @@ -0,0 +1,102 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DescribeRemoteVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** + * 客户VPN网关的资源ID,例如RemoteVPNGatewayIds.0代表希望获取客户VPN网关1的信息,RemoteVPNGatewayIds.1代表客户VPN网关2,如果为空,则返回当前Region中所有客户VPN网关实例的信息 + */ + @UCloudParam("RemoteVPNGatewayIds") + private List remoteVPNGatewayIds; + + /** 业务组名称,若指定则返回业务组下所有客户VPN网关信息 */ + @UCloudParam("Tag") + private String tag; + + /** 数据偏移量, 默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 数据分页值, 默认为20 */ + @UCloudParam("Limit") + private Integer limit; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getRemoteVPNGatewayIds() { + return remoteVPNGatewayIds; + } + + public void setRemoteVPNGatewayIds(List remoteVPNGatewayIds) { + this.remoteVPNGatewayIds = remoteVPNGatewayIds; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayResponse.java new file mode 100644 index 00000000..4841478f --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeRemoteVPNGatewayResponse.java @@ -0,0 +1,134 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DescribeRemoteVPNGatewayResponse extends Response { + + /** 符合条件的客户VPN网关总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 客户VPN网关列表, 每项参数详见 RemoteVPNGatewayDataSet */ + @SerializedName("DataSet") + private List dataSet; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getDataSet() { + return dataSet; + } + + public void setDataSet(List dataSet) { + this.dataSet = dataSet; + } + + public static class RemoteVPNGatewayDataSet extends Response { + + /** 客户网关ID */ + @SerializedName("RemoteVPNGatewayId") + private String remoteVPNGatewayId; + + /** 客户网关名称 */ + @SerializedName("RemoteVPNGatewayName") + private String remoteVPNGatewayName; + + /** 客户网关IP地址 */ + @SerializedName("RemoteVPNGatewayAddr") + private String remoteVPNGatewayAddr; + + /** 用户组 */ + @SerializedName("Tag") + private String tag; + + /** 备注 */ + @SerializedName("Remark") + private String remark; + + /** 创建时间 */ + @SerializedName("CreateTime") + private Integer createTime; + + /** 活跃的隧道数量 */ + @SerializedName("TunnelCount") + private Integer tunnelCount; + + public String getRemoteVPNGatewayId() { + return remoteVPNGatewayId; + } + + public void setRemoteVPNGatewayId(String remoteVPNGatewayId) { + this.remoteVPNGatewayId = remoteVPNGatewayId; + } + + public String getRemoteVPNGatewayName() { + return remoteVPNGatewayName; + } + + public void setRemoteVPNGatewayName(String remoteVPNGatewayName) { + this.remoteVPNGatewayName = remoteVPNGatewayName; + } + + public String getRemoteVPNGatewayAddr() { + return remoteVPNGatewayAddr; + } + + public void setRemoteVPNGatewayAddr(String remoteVPNGatewayAddr) { + this.remoteVPNGatewayAddr = remoteVPNGatewayAddr; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getCreateTime() { + return createTime; + } + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public Integer getTunnelCount() { + return tunnelCount; + } + + public void setTunnelCount(Integer tunnelCount) { + this.tunnelCount = tunnelCount; + } + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayRequest.java new file mode 100644 index 00000000..7ebe7835 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayRequest.java @@ -0,0 +1,111 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DescribeVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** + * VPN网关的资源ID,例如VPNGatewayIds.0代表希望获取VPN网关1的信息,VPNGatewayIds.1代表VPN网关2,如果为空,则返回当前Region中所有VPN网关的信息 + */ + @UCloudParam("VPNGatewayIds") + private List vpnGatewayIds; + + /** VPC的资源ID,返回指定的VPC下的所有VPN网关的信息。默认返回当前Region中所有VPN网关实例的信息 */ + @UCloudParam("VPCId") + private String vpcId; + + /** 数据偏移量。默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 业务组名称,若指定则返回指定的业务组下的所有VPN网关的信息。 */ + @UCloudParam("Tag") + private String tag; + + /** 数据分页值。默认为20 */ + @UCloudParam("Limit") + private Integer limit; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getVPNGatewayIds() { + return vpnGatewayIds; + } + + public void setVPNGatewayIds(List vpnGatewayIds) { + this.vpnGatewayIds = vpnGatewayIds; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayResponse.java new file mode 100644 index 00000000..caaf4dfa --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNGatewayResponse.java @@ -0,0 +1,218 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DescribeVPNGatewayResponse extends Response { + + /** 满足条件的VPN网关总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 获取的VPN网关信息列表,每项参数详见 VPNGatewayDataSet */ + @SerializedName("DataSet") + private List dataSet; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getDataSet() { + return dataSet; + } + + public void setDataSet(List dataSet) { + this.dataSet = dataSet; + } + + public static class VPNGatewayDataSet extends Response { + + /** 网关Id */ + @SerializedName("VPNGatewayId") + private String vpnGatewayId; + + /** 网关名字 */ + @SerializedName("VPNGatewayName") + private String vpnGatewayName; + + /** 网关业务组 */ + @SerializedName("Tag") + private String tag; + + /** 网关备注 */ + @SerializedName("Remark") + private String remark; + + /** 所属VPCId */ + @SerializedName("VPCId") + private String vpcId; + + /** 所属VPC名字 */ + @SerializedName("VPCName") + private String vpcName; + + /** 付费类型 */ + @SerializedName("ChargeType") + private String chargeType; + + /** 创建时间 */ + @SerializedName("CreateTime") + private Integer createTime; + + /** 到期时间 */ + @SerializedName("ExpireTime") + private Integer expireTime; + + /** 是否自动续费 */ + @SerializedName("AutoRenew") + private String autoRenew; + + /** 网关类型 */ + @SerializedName("Grade") + private String grade; + + /** 绑定EIP的IP地址 */ + @SerializedName("EIP") + private String eip; + + /** EIP类型 */ + @SerializedName("EIPType") + private String eipType; + + /** EIPID */ + @SerializedName("EIPId") + private String eipId; + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public String getVPNGatewayName() { + return vpnGatewayName; + } + + public void setVPNGatewayName(String vpnGatewayName) { + this.vpnGatewayName = vpnGatewayName; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getVPCName() { + return vpcName; + } + + public void setVPCName(String vpcName) { + this.vpcName = vpcName; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Integer getCreateTime() { + return createTime; + } + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public Integer getExpireTime() { + return expireTime; + } + + public void setExpireTime(Integer expireTime) { + this.expireTime = expireTime; + } + + public String getAutoRenew() { + return autoRenew; + } + + public void setAutoRenew(String autoRenew) { + this.autoRenew = autoRenew; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public String getEIP() { + return eip; + } + + public void setEIP(String eip) { + this.eip = eip; + } + + public String getEIPType() { + return eipType; + } + + public void setEIPType(String eipType) { + this.eipType = eipType; + } + + public String getEIPId() { + return eipId; + } + + public void setEIPId(String eipId) { + this.eipId = eipId; + } + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelRequest.java new file mode 100644 index 00000000..4b4e165c --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelRequest.java @@ -0,0 +1,99 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DescribeVPNTunnelRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** + * VPN隧道的资源ID,例如VPNTunnelIds.0代表希望获取信息的VPN隧道1,VPNTunneIds.1代表VPN隧道2,如果为空,则返回当前Region中所有的VPN隧道实例 + */ + @UCloudParam("VPNTunnelIds") + private List vpnTunnelIds; + + /** 数据偏移量, 默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 数据分页值, 默认为20 */ + @UCloudParam("Limit") + private Integer limit; + + /** 业务组名称,若指定则返回指定的业务组下的所有VPN网关的信息 */ + @UCloudParam("Tag") + private String tag; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public List getVPNTunnelIds() { + return vpnTunnelIds; + } + + public void setVPNTunnelIds(List vpnTunnelIds) { + this.vpnTunnelIds = vpnTunnelIds; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelResponse.java new file mode 100644 index 00000000..b29091da --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/DescribeVPNTunnelResponse.java @@ -0,0 +1,416 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DescribeVPNTunnelResponse extends Response { + + /** VPN隧道总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 获取的VPN隧道信息列表,每项参数详见 VPNTunnelDataSet */ + @SerializedName("DataSet") + private List dataSet; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getDataSet() { + return dataSet; + } + + public void setDataSet(List dataSet) { + this.dataSet = dataSet; + } + + public static class IKEData extends Response { + + /** IKE认证算法 */ + @SerializedName("IKEAuthenticationAlgorithm") + private String ikeAuthenticationAlgorithm; + + /** IKEDH组 */ + @SerializedName("IKEDhGroup") + private String ikeDhGroup; + + /** IKE加密算法 */ + @SerializedName("IKEEncryptionAlgorithm") + private String ikeEncryptionAlgorithm; + + /** IKEv1协商模式 */ + @SerializedName("IKEExchangeMode") + private String ikeExchangeMode; + + /** IKE本地ID标识 */ + @SerializedName("IKELocalId") + private String ikeLocalId; + + /** IKE预共享秘钥 */ + @SerializedName("IKEPreSharedKey") + private String ikePreSharedKey; + + /** IKE对端ID标识 */ + @SerializedName("IKERemoteId") + private String ikeRemoteId; + + /** IKE秘钥生存时间 */ + @SerializedName("IKESALifetime") + private String ikesaLifetime; + + /** IKE版本 */ + @SerializedName("IKEVersion") + private String ikeVersion; + + public String getIKEAuthenticationAlgorithm() { + return ikeAuthenticationAlgorithm; + } + + public void setIKEAuthenticationAlgorithm(String ikeAuthenticationAlgorithm) { + this.ikeAuthenticationAlgorithm = ikeAuthenticationAlgorithm; + } + + public String getIKEDhGroup() { + return ikeDhGroup; + } + + public void setIKEDhGroup(String ikeDhGroup) { + this.ikeDhGroup = ikeDhGroup; + } + + public String getIKEEncryptionAlgorithm() { + return ikeEncryptionAlgorithm; + } + + public void setIKEEncryptionAlgorithm(String ikeEncryptionAlgorithm) { + this.ikeEncryptionAlgorithm = ikeEncryptionAlgorithm; + } + + public String getIKEExchangeMode() { + return ikeExchangeMode; + } + + public void setIKEExchangeMode(String ikeExchangeMode) { + this.ikeExchangeMode = ikeExchangeMode; + } + + public String getIKELocalId() { + return ikeLocalId; + } + + public void setIKELocalId(String ikeLocalId) { + this.ikeLocalId = ikeLocalId; + } + + public String getIKEPreSharedKey() { + return ikePreSharedKey; + } + + public void setIKEPreSharedKey(String ikePreSharedKey) { + this.ikePreSharedKey = ikePreSharedKey; + } + + public String getIKERemoteId() { + return ikeRemoteId; + } + + public void setIKERemoteId(String ikeRemoteId) { + this.ikeRemoteId = ikeRemoteId; + } + + public String getIKESALifetime() { + return ikesaLifetime; + } + + public void setIKESALifetime(String ikesaLifetime) { + this.ikesaLifetime = ikesaLifetime; + } + + public String getIKEVersion() { + return ikeVersion; + } + + public void setIKEVersion(String ikeVersion) { + this.ikeVersion = ikeVersion; + } + } + + public static class IPSecData extends Response { + + /** IPSec通道中使用的认证算法 */ + @SerializedName("IPSecAuthenticationAlgorithm") + private String ipSecAuthenticationAlgorithm; + + /** IPSec通道中使用的加密算法 */ + @SerializedName("IPSecEncryptionAlgorithm") + private String ipSecEncryptionAlgorithm; + + /** 指定VPN连接的本地子网,用逗号分隔 */ + @SerializedName("IPSecLocalSubnetIds") + private List ipSecLocalSubnetIds; + + /** 使用的安全协议,ESP或AH */ + @SerializedName("IPSecProtocol") + private String ipSecProtocol; + + /** 指定VPN连接的客户网段,用逗号分隔 */ + @SerializedName("IPSecRemoteSubnets") + private List ipSecRemoteSubnets; + + /** IPSec中SA的生存时间 */ + @SerializedName("IPSecSALifetime") + private String ipSecSALifetime; + + /** IPSec中SA的生存时间(以字节计) */ + @SerializedName("IPSecSALifetimeBytes") + private String ipSecSALifetimeBytes; + + /** 是否开启PFS功能,Disable表示关闭,数字表示DH组 */ + @SerializedName("IPSecPFSDhGroup") + private String ipSecPFSDhGroup; + + public String getIPSecAuthenticationAlgorithm() { + return ipSecAuthenticationAlgorithm; + } + + public void setIPSecAuthenticationAlgorithm(String ipSecAuthenticationAlgorithm) { + this.ipSecAuthenticationAlgorithm = ipSecAuthenticationAlgorithm; + } + + public String getIPSecEncryptionAlgorithm() { + return ipSecEncryptionAlgorithm; + } + + public void setIPSecEncryptionAlgorithm(String ipSecEncryptionAlgorithm) { + this.ipSecEncryptionAlgorithm = ipSecEncryptionAlgorithm; + } + + public List getIPSecLocalSubnetIds() { + return ipSecLocalSubnetIds; + } + + public void setIPSecLocalSubnetIds(List ipSecLocalSubnetIds) { + this.ipSecLocalSubnetIds = ipSecLocalSubnetIds; + } + + public String getIPSecProtocol() { + return ipSecProtocol; + } + + public void setIPSecProtocol(String ipSecProtocol) { + this.ipSecProtocol = ipSecProtocol; + } + + public List getIPSecRemoteSubnets() { + return ipSecRemoteSubnets; + } + + public void setIPSecRemoteSubnets(List ipSecRemoteSubnets) { + this.ipSecRemoteSubnets = ipSecRemoteSubnets; + } + + public String getIPSecSALifetime() { + return ipSecSALifetime; + } + + public void setIPSecSALifetime(String ipSecSALifetime) { + this.ipSecSALifetime = ipSecSALifetime; + } + + public String getIPSecSALifetimeBytes() { + return ipSecSALifetimeBytes; + } + + public void setIPSecSALifetimeBytes(String ipSecSALifetimeBytes) { + this.ipSecSALifetimeBytes = ipSecSALifetimeBytes; + } + + public String getIPSecPFSDhGroup() { + return ipSecPFSDhGroup; + } + + public void setIPSecPFSDhGroup(String ipSecPFSDhGroup) { + this.ipSecPFSDhGroup = ipSecPFSDhGroup; + } + } + + public static class VPNTunnelDataSet extends Response { + + /** 隧道id */ + @SerializedName("VPNTunnelId") + private String vpnTunnelId; + + /** 隧道名称 */ + @SerializedName("VPNTunnelName") + private String vpnTunnelName; + + /** 用户组 */ + @SerializedName("Tag") + private String tag; + + /** 备注 */ + @SerializedName("Remark") + private String remark; + + /** 所属VPN网关id */ + @SerializedName("VPNGatewayId") + private String vpnGatewayId; + + /** 对端网关Id */ + @SerializedName("RemoteVPNGatewayId") + private String remoteVPNGatewayId; + + /** VPN网关名字 */ + @SerializedName("VPNGatewayName") + private String vpnGatewayName; + + /** 对端网关名字 */ + @SerializedName("RemoteVPNGatewayName") + private String remoteVPNGatewayName; + + /** 所属VPCId */ + @SerializedName("VPCId") + private String vpcId; + + /** 所属VOC名字 */ + @SerializedName("VPCName") + private String vpcName; + + /** 创建时间 */ + @SerializedName("CreateTime") + private Integer createTime; + + /** IKE参数 */ + @SerializedName("IKEData") + private IKEData ikeData; + + /** IPSec参数 */ + @SerializedName("IPSecData") + private IPSecData ipSecData; + + public String getVPNTunnelId() { + return vpnTunnelId; + } + + public void setVPNTunnelId(String vpnTunnelId) { + this.vpnTunnelId = vpnTunnelId; + } + + public String getVPNTunnelName() { + return vpnTunnelName; + } + + public void setVPNTunnelName(String vpnTunnelName) { + this.vpnTunnelName = vpnTunnelName; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public String getRemoteVPNGatewayId() { + return remoteVPNGatewayId; + } + + public void setRemoteVPNGatewayId(String remoteVPNGatewayId) { + this.remoteVPNGatewayId = remoteVPNGatewayId; + } + + public String getVPNGatewayName() { + return vpnGatewayName; + } + + public void setVPNGatewayName(String vpnGatewayName) { + this.vpnGatewayName = vpnGatewayName; + } + + public String getRemoteVPNGatewayName() { + return remoteVPNGatewayName; + } + + public void setRemoteVPNGatewayName(String remoteVPNGatewayName) { + this.remoteVPNGatewayName = remoteVPNGatewayName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getVPCName() { + return vpcName; + } + + public void setVPCName(String vpcName) { + this.vpcName = vpcName; + } + + public Integer getCreateTime() { + return createTime; + } + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public IKEData getIKEData() { + return ikeData; + } + + public void setIKEData(IKEData ikeData) { + this.ikeData = ikeData; + } + + public IPSecData getIPSecData() { + return ipSecData; + } + + public void setIPSecData(IPSecData ipSecData) { + this.ipSecData = ipSecData; + } + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceRequest.java new file mode 100644 index 00000000..4dd213b6 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceRequest.java @@ -0,0 +1,85 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetVPNGatewayPriceRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN网关规格。枚举值,包括:标准型:Standard,增强型:Enhanced。 */ + @NotEmpty + @UCloudParam("Grade") + private String grade; + + /** 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按需付费(需开启权限); 默认为获取三种价格 */ + @UCloudParam("ChargeType") + private String chargeType; + + /** 购买时长, 默认: 1 */ + @UCloudParam("Quantity") + private Integer quantity; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceResponse.java new file mode 100644 index 00000000..b5a1ece1 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayPriceResponse.java @@ -0,0 +1,74 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GetVPNGatewayPriceResponse extends Response { + + /** 获取的VPN网关价格信息列表,每项参数详见 VPNGatewayPriceSet */ + @SerializedName("PriceSet") + private List priceSet; + + public List getPriceSet() { + return priceSet; + } + + public void setPriceSet(List priceSet) { + this.priceSet = priceSet; + } + + public static class VPNGatewayPriceSet extends Response { + + /** VPN网关付费方式 */ + @SerializedName("ChargeType") + private String chargeType; + + /** VPN网关价格, 单位"元" */ + @SerializedName("Price") + private Double price; + + /** 资源有效期, 以Unix Timestamp表示 */ + @SerializedName("PurchaseValue") + private Integer purchaseValue; + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Integer getPurchaseValue() { + return purchaseValue; + } + + public void setPurchaseValue(Integer purchaseValue) { + this.purchaseValue = purchaseValue; + } + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceRequest.java new file mode 100644 index 00000000..95b7ff48 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceRequest.java @@ -0,0 +1,74 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetVPNGatewayUpgradePriceRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN网关的资源ID */ + @NotEmpty + @UCloudParam("VPNGatewayId") + private String vpnGatewayId; + + /** 更改的VPN网关规格,枚举值为: Standard, 标准型; Enhanced, 增强型。 */ + @NotEmpty + @UCloudParam("Grade") + private String grade; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceResponse.java new file mode 100644 index 00000000..83247212 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/GetVPNGatewayUpgradePriceResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class GetVPNGatewayUpgradePriceResponse extends Response { + + /** 调整规格后的VPN网关价格, 单位为"元", 如需退费此处为负值 */ + @SerializedName("Price") + private Double price; + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayRequest.java new file mode 100644 index 00000000..eba6c3bc --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayRequest.java @@ -0,0 +1,74 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class UpdateVPNGatewayRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](../summary/regionlist.html) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN网关的资源ID */ + @NotEmpty + @UCloudParam("VPNGatewayId") + private String vpnGatewayId; + + /** 网关规格。枚举值为: Standard, 标准型; Enhanced, 增强型。 */ + @NotEmpty + @UCloudParam("Grade") + private String grade; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNGatewayId() { + return vpnGatewayId; + } + + public void setVPNGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + public String getGrade() { + return grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayResponse.java new file mode 100644 index 00000000..5d241959 --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNGatewayResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + + +import cn.ucloud.common.response.Response; + +public class UpdateVPNGatewayResponse extends Response {} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeRequest.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeRequest.java new file mode 100644 index 00000000..2a2fe75a --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeRequest.java @@ -0,0 +1,281 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UpdateVPNTunnelAttributeRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @NotEmpty + @UCloudParam("ProjectId") + private String projectId; + + /** VPN隧道的资源ID */ + @NotEmpty + @UCloudParam("VPNTunnelId") + private String vpnTunnelId; + + /** 预共享密钥 */ + @UCloudParam("IKEPreSharedKey") + private String ikePreSharedKey; + + /** IKE协商过程中使用的加密算法 */ + @UCloudParam("IKEEncryptionAlgorithm") + private String ikeEncryptionAlgorithm; + + /** IKE协商过程中使用的认证算法 */ + @UCloudParam("IKEAuthenticationAlgorithm") + private String ikeAuthenticationAlgorithm; + + /** IKE协商过程中使用的模式,可选“主动模式”与“野蛮模式”。IKEV2不使用该参数。 */ + @UCloudParam("IKEExchangeMode") + private String ikeExchangeMode; + + /** 本端标识。不填时默认使用之前的参数,结合IKEversion进行校验,IKEV2时不能为auto。 */ + @UCloudParam("IKELocalId") + private String ikeLocalId; + + /** 客户端标识。不填时默认使用之前的参数,结合IKEversion进行校验,IKEV2时不能为auto。 */ + @UCloudParam("IKERemoteId") + private String ikeRemoteId; + + /** IKE协商过程中使用的DH组 */ + @UCloudParam("IKEDhGroup") + private String ikeDhGroup; + + /** IKE中SA的生存时间 */ + @UCloudParam("IKESALifetime") + private String ikesaLifetime; + + /** 使用的安全协议,ESP或AH */ + @UCloudParam("IPSecProtocol") + private String ipSecProtocol; + + /** 指定VPN连接的本地子网的id,用逗号分隔 */ + @UCloudParam("IPSecLocalSubnetIds") + private List ipSecLocalSubnetIds; + + /** 指定VPN连接的客户网段,用逗号分隔 */ + @UCloudParam("IPSecRemoteSubnets") + private List ipSecRemoteSubnets; + + /** IPSec隧道中使用的加密算法 */ + @UCloudParam("IPSecEncryptionAlgorithm") + private String ipSecEncryptionAlgorithm; + + /** IPSec隧道中使用的认证算法 */ + @UCloudParam("IPSecAuthenticationAlgorithm") + private String ipSecAuthenticationAlgorithm; + + /** IPSec中SA的生存时间 */ + @UCloudParam("IPSecSALifetime") + private String ipSecSALifetime; + + /** IPSec中SA的生存时间(以字节计) */ + @UCloudParam("IPSecSALifetimeBytes") + private String ipSecSALifetimeBytes; + + /** IPSec中的PFS是否开启 */ + @UCloudParam("IPSecPFSDhGroup") + private String ipSecPFSDhGroup; + + /** 枚举值:"IKE V1","IKE V2" */ + @UCloudParam("IKEVersion") + private String ikeVersion; + + /** IPSec隧道关闭后的处理动作,默认与原本一致,若原本为空,必传。枚举值:“none”,不处理(推荐为none,流量会自动触发隧道重建);“restart”重建 */ + @UCloudParam("IPSecCloseAction") + private String ipSecCloseAction; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPNTunnelId() { + return vpnTunnelId; + } + + public void setVPNTunnelId(String vpnTunnelId) { + this.vpnTunnelId = vpnTunnelId; + } + + public String getIKEPreSharedKey() { + return ikePreSharedKey; + } + + public void setIKEPreSharedKey(String ikePreSharedKey) { + this.ikePreSharedKey = ikePreSharedKey; + } + + public String getIKEEncryptionAlgorithm() { + return ikeEncryptionAlgorithm; + } + + public void setIKEEncryptionAlgorithm(String ikeEncryptionAlgorithm) { + this.ikeEncryptionAlgorithm = ikeEncryptionAlgorithm; + } + + public String getIKEAuthenticationAlgorithm() { + return ikeAuthenticationAlgorithm; + } + + public void setIKEAuthenticationAlgorithm(String ikeAuthenticationAlgorithm) { + this.ikeAuthenticationAlgorithm = ikeAuthenticationAlgorithm; + } + + public String getIKEExchangeMode() { + return ikeExchangeMode; + } + + public void setIKEExchangeMode(String ikeExchangeMode) { + this.ikeExchangeMode = ikeExchangeMode; + } + + public String getIKELocalId() { + return ikeLocalId; + } + + public void setIKELocalId(String ikeLocalId) { + this.ikeLocalId = ikeLocalId; + } + + public String getIKERemoteId() { + return ikeRemoteId; + } + + public void setIKERemoteId(String ikeRemoteId) { + this.ikeRemoteId = ikeRemoteId; + } + + public String getIKEDhGroup() { + return ikeDhGroup; + } + + public void setIKEDhGroup(String ikeDhGroup) { + this.ikeDhGroup = ikeDhGroup; + } + + public String getIKESALifetime() { + return ikesaLifetime; + } + + public void setIKESALifetime(String ikesaLifetime) { + this.ikesaLifetime = ikesaLifetime; + } + + public String getIPSecProtocol() { + return ipSecProtocol; + } + + public void setIPSecProtocol(String ipSecProtocol) { + this.ipSecProtocol = ipSecProtocol; + } + + public List getIPSecLocalSubnetIds() { + return ipSecLocalSubnetIds; + } + + public void setIPSecLocalSubnetIds(List ipSecLocalSubnetIds) { + this.ipSecLocalSubnetIds = ipSecLocalSubnetIds; + } + + public List getIPSecRemoteSubnets() { + return ipSecRemoteSubnets; + } + + public void setIPSecRemoteSubnets(List ipSecRemoteSubnets) { + this.ipSecRemoteSubnets = ipSecRemoteSubnets; + } + + public String getIPSecEncryptionAlgorithm() { + return ipSecEncryptionAlgorithm; + } + + public void setIPSecEncryptionAlgorithm(String ipSecEncryptionAlgorithm) { + this.ipSecEncryptionAlgorithm = ipSecEncryptionAlgorithm; + } + + public String getIPSecAuthenticationAlgorithm() { + return ipSecAuthenticationAlgorithm; + } + + public void setIPSecAuthenticationAlgorithm(String ipSecAuthenticationAlgorithm) { + this.ipSecAuthenticationAlgorithm = ipSecAuthenticationAlgorithm; + } + + public String getIPSecSALifetime() { + return ipSecSALifetime; + } + + public void setIPSecSALifetime(String ipSecSALifetime) { + this.ipSecSALifetime = ipSecSALifetime; + } + + public String getIPSecSALifetimeBytes() { + return ipSecSALifetimeBytes; + } + + public void setIPSecSALifetimeBytes(String ipSecSALifetimeBytes) { + this.ipSecSALifetimeBytes = ipSecSALifetimeBytes; + } + + public String getIPSecPFSDhGroup() { + return ipSecPFSDhGroup; + } + + public void setIPSecPFSDhGroup(String ipSecPFSDhGroup) { + this.ipSecPFSDhGroup = ipSecPFSDhGroup; + } + + public String getIKEVersion() { + return ikeVersion; + } + + public void setIKEVersion(String ikeVersion) { + this.ikeVersion = ikeVersion; + } + + public String getIPSecCloseAction() { + return ipSecCloseAction; + } + + public void setIPSecCloseAction(String ipSecCloseAction) { + this.ipSecCloseAction = ipSecCloseAction; + } +} diff --git a/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeResponse.java b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeResponse.java new file mode 100644 index 00000000..3508fe1c --- /dev/null +++ b/ucloud-sdk-java-ipsecvpn/src/main/java/cn/ucloud/ipsecvpn/models/UpdateVPNTunnelAttributeResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.ipsecvpn.models; + + + +import cn.ucloud.common.response.Response; + +public class UpdateVPNTunnelAttributeResponse extends Response {} diff --git a/ucloud-sdk-java-label/pom.xml b/ucloud-sdk-java-label/pom.xml new file mode 100644 index 00000000..16160c81 --- /dev/null +++ b/ucloud-sdk-java-label/pom.xml @@ -0,0 +1,49 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-java-label + ucloud-sdk-java + 1.2.51-release + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + + com.google.code.gson + gson + + + + commons-codec + commons-codec + + + org.apache.commons + commons-lang3 + + + + junit + junit + test + + + + org.slf4j + slf4j-simple + provided + + + diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClient.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClient.java new file mode 100644 index 00000000..bfce0ab9 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClient.java @@ -0,0 +1,151 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.client; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.label.models.BindLabelsRequest; +import cn.ucloud.label.models.BindLabelsResponse; +import cn.ucloud.label.models.CreateLabelsRequest; +import cn.ucloud.label.models.CreateLabelsResponse; +import cn.ucloud.label.models.DeleteLabelsRequest; +import cn.ucloud.label.models.DeleteLabelsResponse; +import cn.ucloud.label.models.ListLabelsByResourceIdsRequest; +import cn.ucloud.label.models.ListLabelsByResourceIdsResponse; +import cn.ucloud.label.models.ListLabelsRequest; +import cn.ucloud.label.models.ListLabelsResponse; +import cn.ucloud.label.models.ListProjectsByLabelsRequest; +import cn.ucloud.label.models.ListProjectsByLabelsResponse; +import cn.ucloud.label.models.ListResourcesByLabelsRequest; +import cn.ucloud.label.models.ListResourcesByLabelsResponse; +import cn.ucloud.label.models.ListResourcesTypesForLabelRequest; +import cn.ucloud.label.models.ListResourcesTypesForLabelResponse; +import cn.ucloud.label.models.UnbindLabelsRequest; +import cn.ucloud.label.models.UnbindLabelsResponse; + +/** This client is used to call actions of **Label** service */ +public class LabelClient extends DefaultClient implements LabelClientInterface { + public LabelClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * BindLabels - 绑定标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindLabelsResponse bindLabels(BindLabelsRequest request) throws UCloudException { + request.setAction("BindLabels"); + return (BindLabelsResponse) this.invoke(request, BindLabelsResponse.class); + } + + /** + * CreateLabels - 创建标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateLabelsResponse createLabels(CreateLabelsRequest request) throws UCloudException { + request.setAction("CreateLabels"); + return (CreateLabelsResponse) this.invoke(request, CreateLabelsResponse.class); + } + + /** + * DeleteLabels - 删除标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteLabelsResponse deleteLabels(DeleteLabelsRequest request) throws UCloudException { + request.setAction("DeleteLabels"); + return (DeleteLabelsResponse) this.invoke(request, DeleteLabelsResponse.class); + } + + /** + * ListLabels - 标签列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListLabelsResponse listLabels(ListLabelsRequest request) throws UCloudException { + request.setAction("ListLabels"); + return (ListLabelsResponse) this.invoke(request, ListLabelsResponse.class); + } + + /** + * ListLabelsByResourceIds - 根据资源ID获取标签列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListLabelsByResourceIdsResponse listLabelsByResourceIds( + ListLabelsByResourceIdsRequest request) throws UCloudException { + request.setAction("ListLabelsByResourceIds"); + return (ListLabelsByResourceIdsResponse) + this.invoke(request, ListLabelsByResourceIdsResponse.class); + } + + /** + * ListProjectsByLabels - 根据标签获取项目列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListProjectsByLabelsResponse listProjectsByLabels(ListProjectsByLabelsRequest request) + throws UCloudException { + request.setAction("ListProjectsByLabels"); + return (ListProjectsByLabelsResponse) + this.invoke(request, ListProjectsByLabelsResponse.class); + } + + /** + * ListResourcesByLabels - 根据标签获取资源列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListResourcesByLabelsResponse listResourcesByLabels(ListResourcesByLabelsRequest request) + throws UCloudException { + request.setAction("ListResourcesByLabels"); + return (ListResourcesByLabelsResponse) + this.invoke(request, ListResourcesByLabelsResponse.class); + } + + /** + * ListResourcesTypesForLabel - 获取支持标签的资源类型 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListResourcesTypesForLabelResponse listResourcesTypesForLabel( + ListResourcesTypesForLabelRequest request) throws UCloudException { + request.setAction("ListResourcesTypesForLabel"); + return (ListResourcesTypesForLabelResponse) + this.invoke(request, ListResourcesTypesForLabelResponse.class); + } + + /** + * UnbindLabels - 解绑标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnbindLabelsResponse unbindLabels(UnbindLabelsRequest request) throws UCloudException { + request.setAction("UnbindLabels"); + return (UnbindLabelsResponse) this.invoke(request, UnbindLabelsResponse.class); + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClientInterface.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClientInterface.java new file mode 100644 index 00000000..c2f54ebf --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/client/LabelClientInterface.java @@ -0,0 +1,115 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.client; + +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.label.models.BindLabelsRequest; +import cn.ucloud.label.models.BindLabelsResponse; +import cn.ucloud.label.models.CreateLabelsRequest; +import cn.ucloud.label.models.CreateLabelsResponse; +import cn.ucloud.label.models.DeleteLabelsRequest; +import cn.ucloud.label.models.DeleteLabelsResponse; +import cn.ucloud.label.models.ListLabelsByResourceIdsRequest; +import cn.ucloud.label.models.ListLabelsByResourceIdsResponse; +import cn.ucloud.label.models.ListLabelsRequest; +import cn.ucloud.label.models.ListLabelsResponse; +import cn.ucloud.label.models.ListProjectsByLabelsRequest; +import cn.ucloud.label.models.ListProjectsByLabelsResponse; +import cn.ucloud.label.models.ListResourcesByLabelsRequest; +import cn.ucloud.label.models.ListResourcesByLabelsResponse; +import cn.ucloud.label.models.ListResourcesTypesForLabelRequest; +import cn.ucloud.label.models.ListResourcesTypesForLabelResponse; +import cn.ucloud.label.models.UnbindLabelsRequest; +import cn.ucloud.label.models.UnbindLabelsResponse; + +/** This client is used to call actions of **Label** service */ +public interface LabelClientInterface extends Client { + + /** + * BindLabels - 绑定标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindLabelsResponse bindLabels(BindLabelsRequest request) throws UCloudException; + + /** + * CreateLabels - 创建标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateLabelsResponse createLabels(CreateLabelsRequest request) throws UCloudException; + + /** + * DeleteLabels - 删除标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteLabelsResponse deleteLabels(DeleteLabelsRequest request) throws UCloudException; + + /** + * ListLabels - 标签列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListLabelsResponse listLabels(ListLabelsRequest request) throws UCloudException; + + /** + * ListLabelsByResourceIds - 根据资源ID获取标签列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListLabelsByResourceIdsResponse listLabelsByResourceIds( + ListLabelsByResourceIdsRequest request) throws UCloudException; + + /** + * ListProjectsByLabels - 根据标签获取项目列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListProjectsByLabelsResponse listProjectsByLabels(ListProjectsByLabelsRequest request) + throws UCloudException; + + /** + * ListResourcesByLabels - 根据标签获取资源列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListResourcesByLabelsResponse listResourcesByLabels(ListResourcesByLabelsRequest request) + throws UCloudException; + + /** + * ListResourcesTypesForLabel - 获取支持标签的资源类型 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ListResourcesTypesForLabelResponse listResourcesTypesForLabel( + ListResourcesTypesForLabelRequest request) throws UCloudException; + + /** + * UnbindLabels - 解绑标签 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnbindLabelsResponse unbindLabels(UnbindLabelsRequest request) throws UCloudException; +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsRequest.java new file mode 100644 index 00000000..4856dc88 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class BindLabelsRequest extends Request { + + /** 资源id数组 */ + @NotEmpty + @UCloudParam("ResourceIds") + private List resourceIds; + + /** */ + @UCloudParam("Labels") + private List labels; + + public List getResourceIds() { + return resourceIds; + } + + public void setResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsResponse.java new file mode 100644 index 00000000..9d22058b --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/BindLabelsResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + + +import cn.ucloud.common.response.Response; + +public class BindLabelsResponse extends Response {} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsRequest.java new file mode 100644 index 00000000..b7d6cbaa --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsRequest.java @@ -0,0 +1,64 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class CreateLabelsRequest extends Request { + + /** */ + @UCloudParam("Labels") + private List labels; + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsResponse.java new file mode 100644 index 00000000..9b31e0fc --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/CreateLabelsResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + + +import cn.ucloud.common.response.Response; + +public class CreateLabelsResponse extends Response {} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsRequest.java new file mode 100644 index 00000000..69bc9b64 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsRequest.java @@ -0,0 +1,64 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DeleteLabelsRequest extends Request { + + /** */ + @UCloudParam("Labels") + private List labels; + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsResponse.java new file mode 100644 index 00000000..f2d28e48 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/DeleteLabelsResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteLabelsResponse extends Response {} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsRequest.java new file mode 100644 index 00000000..e47dd2d3 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsRequest.java @@ -0,0 +1,60 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListLabelsByResourceIdsRequest extends Request { + + /** 资源id数组 */ + @NotEmpty + @UCloudParam("ResourceIds") + private List resourceIds; + + /** 列表起始位置偏移量,默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 返回数据长度,默认为10,最大100 */ + @UCloudParam("Limit") + private Integer limit; + + public List getResourceIds() { + return resourceIds; + } + + public void setResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsResponse.java new file mode 100644 index 00000000..24798204 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsByResourceIdsResponse.java @@ -0,0 +1,98 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListLabelsByResourceIdsResponse extends Response { + + /** 资源标签总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 资源标签数组 */ + @SerializedName("Labels") + private List labels; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class ListLabelsByResourceIdsLabel extends Response { + + /** 资源id */ + @SerializedName("ResourceId") + private String resourceId; + + /** 标签键 */ + @SerializedName("Key") + private String key; + + /** 标签值 */ + @SerializedName("Value") + private String value; + + /** 标签类型,system:系统标签;custom:自定义标签 */ + @SerializedName("Category") + private String category; + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsRequest.java new file mode 100644 index 00000000..132beca3 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsRequest.java @@ -0,0 +1,59 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class ListLabelsRequest extends Request { + + /** 标签类型,system:系统标签;custom:自定义标签 */ + @NotEmpty + @UCloudParam("Category") + private String category; + + /** 列表起始位置偏移量,默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 返回数据长度,默认为10,最大100 */ + @UCloudParam("Limit") + private Integer limit; + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsResponse.java new file mode 100644 index 00000000..86f32d03 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListLabelsResponse.java @@ -0,0 +1,86 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListLabelsResponse extends Response { + + /** 标签总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 标签数组 */ + @SerializedName("Labels") + private List labels; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class ListLabelsLabel extends Response { + + /** 标签键 */ + @SerializedName("Key") + private String key; + + /** 标签值 */ + @SerializedName("Value") + private String value; + + /** 资源数量 */ + @SerializedName("ResourceCount") + private Integer resourceCount; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Integer getResourceCount() { + return resourceCount; + } + + public void setResourceCount(Integer resourceCount) { + this.resourceCount = resourceCount; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsRequest.java new file mode 100644 index 00000000..52dae28b --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsRequest.java @@ -0,0 +1,64 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListProjectsByLabelsRequest extends Request { + + /** */ + @UCloudParam("Labels") + private List labels; + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsResponse.java new file mode 100644 index 00000000..f4c1bac8 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListProjectsByLabelsResponse.java @@ -0,0 +1,86 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListProjectsByLabelsResponse extends Response { + + /** 项目列表 */ + @SerializedName("Projects") + private List projects; + + public List getProjects() { + return projects; + } + + public void setProjects(List projects) { + this.projects = projects; + } + + public static class ListProjectsByLabelsProject extends Response { + + /** 项目id */ + @SerializedName("ProjectId") + private String projectId; + + /** 项目名称 */ + @SerializedName("ProjectName") + private String projectName; + + /** 资源类型列表 */ + @SerializedName("ResourceTypes") + private List resourceTypes; + + /** 禁用的资源类型列表 */ + @SerializedName("DisabledResourceTypes") + private List disabledResourceTypes; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public List getResourceTypes() { + return resourceTypes; + } + + public void setResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + } + + public List getDisabledResourceTypes() { + return disabledResourceTypes; + } + + public void setDisabledResourceTypes(List disabledResourceTypes) { + this.disabledResourceTypes = disabledResourceTypes; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsRequest.java new file mode 100644 index 00000000..0ef3fc89 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsRequest.java @@ -0,0 +1,114 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class ListResourcesByLabelsRequest extends Request { + + /** */ + @UCloudParam("Labels") + private List labels; + + /** 资源类型数组 */ + @NotEmpty + @UCloudParam("ResourceTypes") + private List resourceTypes; + + /** 项目id数组 */ + @NotEmpty + @UCloudParam("ProjectIds") + private List projectIds; + + /** 列表起始位置偏移量,默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 返回数据长度,默认为 0,最大100 */ + @UCloudParam("Limit") + private Integer limit; + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public List getResourceTypes() { + return resourceTypes; + } + + public void setResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + } + + public List getProjectIds() { + return projectIds; + } + + public void setProjectIds(List projectIds) { + this.projectIds = projectIds; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsResponse.java new file mode 100644 index 00000000..25b93e32 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesByLabelsResponse.java @@ -0,0 +1,161 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListResourcesByLabelsResponse extends Response { + + /** 资源总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 资源列表 */ + @SerializedName("Resources") + private List resources; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + public static class ListResourcesByLabelsLabel extends Response { + + /** 标签键 */ + @SerializedName("Key") + private String key; + + /** 标签值 */ + @SerializedName("Value") + private String value; + + /** 标签类型,system:系统标签;custom:自定义标签 */ + @SerializedName("Category") + private String category; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + } + + public static class ListResourcesByLabelsResource extends Response { + + /** 项目id */ + @SerializedName("ProjectId") + private String projectId; + + /** 资源id */ + @SerializedName("ResourceId") + private String resourceId; + + /** 资源名称 */ + @SerializedName("ResourceName") + private String resourceName; + + /** 项目名称 */ + @SerializedName("ProjectName") + private String projectName; + + /** 资源类型 */ + @SerializedName("ResourceType") + private String resourceType; + + /** 标签数组 */ + @SerializedName("Labels") + private List labels; + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelRequest.java new file mode 100644 index 00000000..65fe39d8 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelRequest.java @@ -0,0 +1,19 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + +import cn.ucloud.common.request.Request; + +public class ListResourcesTypesForLabelRequest extends Request {} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelResponse.java new file mode 100644 index 00000000..4ddd865a --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/ListResourcesTypesForLabelResponse.java @@ -0,0 +1,47 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class ListResourcesTypesForLabelResponse extends Response { + + /** 总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 资源类型列表 */ + @SerializedName("ResourceTypes") + private List resourceTypes; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getResourceTypes() { + return resourceTypes; + } + + public void setResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsRequest.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsRequest.java new file mode 100644 index 00000000..b3c95676 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UnbindLabelsRequest extends Request { + + /** 资源id数组 */ + @NotEmpty + @UCloudParam("ResourceIds") + private List resourceIds; + + /** */ + @UCloudParam("Labels") + private List labels; + + public List getResourceIds() { + return resourceIds; + } + + public void setResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public static class Labels extends Request { + + /** 标签键 */ + @NotEmpty + @UCloudParam("Key") + private String key; + + /** 标签值 */ + @NotEmpty + @UCloudParam("Value") + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsResponse.java b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsResponse.java new file mode 100644 index 00000000..1f7f5614 --- /dev/null +++ b/ucloud-sdk-java-label/src/main/java/cn/ucloud/label/models/UnbindLabelsResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.label.models; + + + +import cn.ucloud.common.response.Response; + +public class UnbindLabelsResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/pom.xml b/ucloud-sdk-java-nlb/pom.xml new file mode 100644 index 00000000..e4550115 --- /dev/null +++ b/ucloud-sdk-java-nlb/pom.xml @@ -0,0 +1,49 @@ + + + + ucloud-sdk-java + cn.ucloud + 1.2.51-release + + + 4.0.0 + ucloud-sdk-java-nlb + ucloud-sdk-java + 1.2.51-release + + + + cn.ucloud + ucloud-sdk-java-common + 1.2.51-release + + + + com.google.code.gson + gson + + + + commons-codec + commons-codec + + + org.apache.commons + commons-lang3 + + + + junit + junit + test + + + + org.slf4j + slf4j-simple + provided + + + diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClient.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClient.java new file mode 100644 index 00000000..8f93ded5 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClient.java @@ -0,0 +1,202 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.client; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.nlb.models.AddNLBTargetsRequest; +import cn.ucloud.nlb.models.AddNLBTargetsResponse; +import cn.ucloud.nlb.models.CreateNLBListenerRequest; +import cn.ucloud.nlb.models.CreateNLBListenerResponse; +import cn.ucloud.nlb.models.CreateNetworkLoadBalancerRequest; +import cn.ucloud.nlb.models.CreateNetworkLoadBalancerResponse; +import cn.ucloud.nlb.models.DeleteNLBListenerRequest; +import cn.ucloud.nlb.models.DeleteNLBListenerResponse; +import cn.ucloud.nlb.models.DeleteNetworkLoadBalancerRequest; +import cn.ucloud.nlb.models.DeleteNetworkLoadBalancerResponse; +import cn.ucloud.nlb.models.DescribeNLBListenersRequest; +import cn.ucloud.nlb.models.DescribeNLBListenersResponse; +import cn.ucloud.nlb.models.DescribeNetworkLoadBalancersRequest; +import cn.ucloud.nlb.models.DescribeNetworkLoadBalancersResponse; +import cn.ucloud.nlb.models.GetNetworkLoadBalancerPriceRequest; +import cn.ucloud.nlb.models.GetNetworkLoadBalancerPriceResponse; +import cn.ucloud.nlb.models.RemoveNLBTargetsRequest; +import cn.ucloud.nlb.models.RemoveNLBTargetsResponse; +import cn.ucloud.nlb.models.UpdateNLBListenerAttributeRequest; +import cn.ucloud.nlb.models.UpdateNLBListenerAttributeResponse; +import cn.ucloud.nlb.models.UpdateNLBTargetsAttributeRequest; +import cn.ucloud.nlb.models.UpdateNLBTargetsAttributeResponse; +import cn.ucloud.nlb.models.UpdateNetworkLoadBalancerAttributeRequest; +import cn.ucloud.nlb.models.UpdateNetworkLoadBalancerAttributeResponse; + +/** This client is used to call actions of **NLB** service */ +public class NLBClient extends DefaultClient implements NLBClientInterface { + public NLBClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * AddNLBTargets - 添加后端服务节点 + * + * @param request Request object + * @throws UCloudException Exception + */ + public AddNLBTargetsResponse addNLBTargets(AddNLBTargetsRequest request) + throws UCloudException { + request.setAction("AddNLBTargets"); + return (AddNLBTargetsResponse) this.invoke(request, AddNLBTargetsResponse.class); + } + + /** + * CreateNLBListener - 创建监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateNLBListenerResponse createNLBListener(CreateNLBListenerRequest request) + throws UCloudException { + request.setAction("CreateNLBListener"); + return (CreateNLBListenerResponse) this.invoke(request, CreateNLBListenerResponse.class); + } + + /** + * CreateNetworkLoadBalancer - 创建网络型负载均衡 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateNetworkLoadBalancerResponse createNetworkLoadBalancer( + CreateNetworkLoadBalancerRequest request) throws UCloudException { + request.setAction("CreateNetworkLoadBalancer"); + return (CreateNetworkLoadBalancerResponse) + this.invoke(request, CreateNetworkLoadBalancerResponse.class); + } + + /** + * DeleteNLBListener - 删除一个网络型负载均衡监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteNLBListenerResponse deleteNLBListener(DeleteNLBListenerRequest request) + throws UCloudException { + request.setAction("DeleteNLBListener"); + return (DeleteNLBListenerResponse) this.invoke(request, DeleteNLBListenerResponse.class); + } + + /** + * DeleteNetworkLoadBalancer - 删除负载均衡实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteNetworkLoadBalancerResponse deleteNetworkLoadBalancer( + DeleteNetworkLoadBalancerRequest request) throws UCloudException { + request.setAction("DeleteNetworkLoadBalancer"); + return (DeleteNetworkLoadBalancerResponse) + this.invoke(request, DeleteNetworkLoadBalancerResponse.class); + } + + /** + * DescribeNLBListeners - 描述监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeNLBListenersResponse describeNLBListeners(DescribeNLBListenersRequest request) + throws UCloudException { + request.setAction("DescribeNLBListeners"); + return (DescribeNLBListenersResponse) + this.invoke(request, DescribeNLBListenersResponse.class); + } + + /** + * DescribeNetworkLoadBalancers - 描述负载均衡实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeNetworkLoadBalancersResponse describeNetworkLoadBalancers( + DescribeNetworkLoadBalancersRequest request) throws UCloudException { + request.setAction("DescribeNetworkLoadBalancers"); + return (DescribeNetworkLoadBalancersResponse) + this.invoke(request, DescribeNetworkLoadBalancersResponse.class); + } + + /** + * GetNetworkLoadBalancerPrice - 获取负载均衡价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetNetworkLoadBalancerPriceResponse getNetworkLoadBalancerPrice( + GetNetworkLoadBalancerPriceRequest request) throws UCloudException { + request.setAction("GetNetworkLoadBalancerPrice"); + return (GetNetworkLoadBalancerPriceResponse) + this.invoke(request, GetNetworkLoadBalancerPriceResponse.class); + } + + /** + * RemoveNLBTargets - 删除后端服务节点 + * + * @param request Request object + * @throws UCloudException Exception + */ + public RemoveNLBTargetsResponse removeNLBTargets(RemoveNLBTargetsRequest request) + throws UCloudException { + request.setAction("RemoveNLBTargets"); + return (RemoveNLBTargetsResponse) this.invoke(request, RemoveNLBTargetsResponse.class); + } + + /** + * UpdateNLBListenerAttribute - 更新监听器属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNLBListenerAttributeResponse updateNLBListenerAttribute( + UpdateNLBListenerAttributeRequest request) throws UCloudException { + request.setAction("UpdateNLBListenerAttribute"); + return (UpdateNLBListenerAttributeResponse) + this.invoke(request, UpdateNLBListenerAttributeResponse.class); + } + + /** + * UpdateNLBTargetsAttribute - 更新后端服务节点属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNLBTargetsAttributeResponse updateNLBTargetsAttribute( + UpdateNLBTargetsAttributeRequest request) throws UCloudException { + request.setAction("UpdateNLBTargetsAttribute"); + return (UpdateNLBTargetsAttributeResponse) + this.invoke(request, UpdateNLBTargetsAttributeResponse.class); + } + + /** + * UpdateNetworkLoadBalancerAttribute - 更新负载均衡实例属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNetworkLoadBalancerAttributeResponse updateNetworkLoadBalancerAttribute( + UpdateNetworkLoadBalancerAttributeRequest request) throws UCloudException { + request.setAction("UpdateNetworkLoadBalancerAttribute"); + return (UpdateNetworkLoadBalancerAttributeResponse) + this.invoke(request, UpdateNetworkLoadBalancerAttributeResponse.class); + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClientInterface.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClientInterface.java new file mode 100644 index 00000000..36673c42 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/client/NLBClientInterface.java @@ -0,0 +1,152 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.client; + +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.nlb.models.AddNLBTargetsRequest; +import cn.ucloud.nlb.models.AddNLBTargetsResponse; +import cn.ucloud.nlb.models.CreateNLBListenerRequest; +import cn.ucloud.nlb.models.CreateNLBListenerResponse; +import cn.ucloud.nlb.models.CreateNetworkLoadBalancerRequest; +import cn.ucloud.nlb.models.CreateNetworkLoadBalancerResponse; +import cn.ucloud.nlb.models.DeleteNLBListenerRequest; +import cn.ucloud.nlb.models.DeleteNLBListenerResponse; +import cn.ucloud.nlb.models.DeleteNetworkLoadBalancerRequest; +import cn.ucloud.nlb.models.DeleteNetworkLoadBalancerResponse; +import cn.ucloud.nlb.models.DescribeNLBListenersRequest; +import cn.ucloud.nlb.models.DescribeNLBListenersResponse; +import cn.ucloud.nlb.models.DescribeNetworkLoadBalancersRequest; +import cn.ucloud.nlb.models.DescribeNetworkLoadBalancersResponse; +import cn.ucloud.nlb.models.GetNetworkLoadBalancerPriceRequest; +import cn.ucloud.nlb.models.GetNetworkLoadBalancerPriceResponse; +import cn.ucloud.nlb.models.RemoveNLBTargetsRequest; +import cn.ucloud.nlb.models.RemoveNLBTargetsResponse; +import cn.ucloud.nlb.models.UpdateNLBListenerAttributeRequest; +import cn.ucloud.nlb.models.UpdateNLBListenerAttributeResponse; +import cn.ucloud.nlb.models.UpdateNLBTargetsAttributeRequest; +import cn.ucloud.nlb.models.UpdateNLBTargetsAttributeResponse; +import cn.ucloud.nlb.models.UpdateNetworkLoadBalancerAttributeRequest; +import cn.ucloud.nlb.models.UpdateNetworkLoadBalancerAttributeResponse; + +/** This client is used to call actions of **NLB** service */ +public interface NLBClientInterface extends Client { + + /** + * AddNLBTargets - 添加后端服务节点 + * + * @param request Request object + * @throws UCloudException Exception + */ + public AddNLBTargetsResponse addNLBTargets(AddNLBTargetsRequest request) throws UCloudException; + + /** + * CreateNLBListener - 创建监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateNLBListenerResponse createNLBListener(CreateNLBListenerRequest request) + throws UCloudException; + + /** + * CreateNetworkLoadBalancer - 创建网络型负载均衡 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateNetworkLoadBalancerResponse createNetworkLoadBalancer( + CreateNetworkLoadBalancerRequest request) throws UCloudException; + + /** + * DeleteNLBListener - 删除一个网络型负载均衡监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteNLBListenerResponse deleteNLBListener(DeleteNLBListenerRequest request) + throws UCloudException; + + /** + * DeleteNetworkLoadBalancer - 删除负载均衡实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteNetworkLoadBalancerResponse deleteNetworkLoadBalancer( + DeleteNetworkLoadBalancerRequest request) throws UCloudException; + + /** + * DescribeNLBListeners - 描述监听器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeNLBListenersResponse describeNLBListeners(DescribeNLBListenersRequest request) + throws UCloudException; + + /** + * DescribeNetworkLoadBalancers - 描述负载均衡实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeNetworkLoadBalancersResponse describeNetworkLoadBalancers( + DescribeNetworkLoadBalancersRequest request) throws UCloudException; + + /** + * GetNetworkLoadBalancerPrice - 获取负载均衡价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetNetworkLoadBalancerPriceResponse getNetworkLoadBalancerPrice( + GetNetworkLoadBalancerPriceRequest request) throws UCloudException; + + /** + * RemoveNLBTargets - 删除后端服务节点 + * + * @param request Request object + * @throws UCloudException Exception + */ + public RemoveNLBTargetsResponse removeNLBTargets(RemoveNLBTargetsRequest request) + throws UCloudException; + + /** + * UpdateNLBListenerAttribute - 更新监听器属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNLBListenerAttributeResponse updateNLBListenerAttribute( + UpdateNLBListenerAttributeRequest request) throws UCloudException; + + /** + * UpdateNLBTargetsAttribute - 更新后端服务节点属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNLBTargetsAttributeResponse updateNLBTargetsAttribute( + UpdateNLBTargetsAttributeRequest request) throws UCloudException; + + /** + * UpdateNetworkLoadBalancerAttribute - 更新负载均衡实例属性 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdateNetworkLoadBalancerAttributeResponse updateNetworkLoadBalancerAttribute( + UpdateNetworkLoadBalancerAttributeRequest request) throws UCloudException; +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsRequest.java new file mode 100644 index 00000000..b83fc8c2 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsRequest.java @@ -0,0 +1,215 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class AddNLBTargetsRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID。 */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的ID。 */ + @NotEmpty + @UCloudParam("ListenerId") + private String listenerId; + + /** */ + @UCloudParam("Targets") + private List targets; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public static class Targets extends Request { + + /** + * 服务节点的类型。限定枚举值:"UHost" / + * "UNI"/"UPM"/"IP",默认值:"UHost";非IP类型,如果该资源有多个IP,将只能添加主IP;非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 + */ + @UCloudParam("ResourceType") + private String resourceType; + + /** 服务节点的资源ID。在非IP类型时,必传 */ + @UCloudParam("ResourceId") + private String resourceId; + + /** 服务节点的资源名称 */ + @UCloudParam("ResourceName") + private String resourceName; + + /** 服务节点的VPC资源ID。在IP类型时,必传 */ + @UCloudParam("VPCId") + private String vpcId; + + /** 服务节点的子网资源ID。 */ + @UCloudParam("SubnetId") + private String subnetId; + + /** 服务节点的IP。在IP类型时,必传 */ + @UCloudParam("ResourceIP") + private String resourceIP; + + /** 服务节点的端口,限定取值:[1-65535] */ + @UCloudParam("Port") + private Integer port; + + /** 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询、加权最小连接数算法时有效 */ + @UCloudParam("Weight") + private Integer weight; + + /** 服务节点是否启用 */ + @UCloudParam("Enabled") + private Boolean enabled; + + /** 服务节点所在地域 */ + @UCloudParam("Region") + private String region; + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getResourceIP() { + return resourceIP; + } + + public void setResourceIP(String resourceIP) { + this.resourceIP = resourceIP; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsResponse.java new file mode 100644 index 00000000..d5f747fb --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/AddNLBTargetsResponse.java @@ -0,0 +1,182 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class AddNLBTargetsResponse extends Response { + + /** */ + @SerializedName("Targets") + private List targets; + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public static class Target extends Response { + + /** 服务节点所在地域 */ + @SerializedName("Region") + private String region; + + /** 服务节点的类型 */ + @SerializedName("ResourceType") + private String resourceType; + + /** 服务节点的资源ID。在非IP类型时,必传 */ + @SerializedName("ResourceId") + private String resourceId; + + /** 服务节点的资源名称 */ + @SerializedName("ResourceName") + private String resourceName; + + /** 服务节点的VPC资源ID。在IP类型时,必传 */ + @SerializedName("VPCId") + private String vpcId; + + /** 服务节点的子网资源ID。在IP类型时,必传 */ + @SerializedName("SubnetId") + private String subnetId; + + /** 服务节点的IP。在IP类型时,必传 */ + @SerializedName("ResourceIP") + private String resourceIP; + + /** 服务节点的端口 */ + @SerializedName("Port") + private Integer port; + + /** 服务节点的权重。支持更新 */ + @SerializedName("Weight") + private Integer weight; + + /** 服务节点是否开启 */ + @SerializedName("Enabled") + private Boolean enabled; + + /** 服务节点的标识 ID 说明: 添加服务节点的时候无需传 更新服务节点属性时必传 */ + @SerializedName("Id") + private String id; + + /** 服务节点的健康检查状态 说明: 描述服务节点信息时显示 限定枚举值:"Healthy"/"Unhealthy" */ + @SerializedName("State") + private String state; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getResourceIP() { + return resourceIP; + } + + public void setResourceIP(String resourceIP) { + this.resourceIP = resourceIP; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerRequest.java new file mode 100644 index 00000000..b0f81928 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerRequest.java @@ -0,0 +1,237 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateNLBListenerRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的名称 限定字符长度:[1-255] 限定特殊字符,仅支持:-_. 默认值:listener */ + @UCloudParam("Name") + private String name; + + /** 监听器的备注信息 限定字符长度:[0-255] */ + @UCloudParam("Remark") + private String remark; + + /** 端口范围的起始端口 限定取值:[1-65535] 默认值 1 */ + @UCloudParam("StartPort") + private Integer startPort; + + /** 端口范围的结束端口 限定取值:[1-65535] 取值不小于起始端口 默认值 65535 */ + @UCloudParam("EndPort") + private Integer endPort; + + /** 监听协议 限定取值:"TCP"/"UDP" */ + @UCloudParam("Protocol") + private String protocol; + + /** + * 负载均衡算法 限定取值:"RoundRobin"/"SourceHash"/"LeastConn"/"WeightLeastConn "/"WeightRoundRobin" 默认值 + * "RoundRobin" + */ + @UCloudParam("Scheduler") + private String scheduler; + + /** 会话保持超时时间。单位:秒 限定取值:[60-900],0 表示不开启会话保持 默认值60 */ + @UCloudParam("StickinessTimeout") + private Integer stickinessTimeout; + + /** */ + @UCloudParam("HealthCheckConfig") + private HealthCheckConfig healthCheckConfig; + + /** 传递源 IP 方法。 限定取值:"" / "None" / "Toa",空字符串和 None 代表关闭。 */ + @UCloudParam("ForwardSrcIPMethod") + private String forwardSrcIPMethod; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getStartPort() { + return startPort; + } + + public void setStartPort(Integer startPort) { + this.startPort = startPort; + } + + public Integer getEndPort() { + return endPort; + } + + public void setEndPort(Integer endPort) { + this.endPort = endPort; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getScheduler() { + return scheduler; + } + + public void setScheduler(String scheduler) { + this.scheduler = scheduler; + } + + public Integer getStickinessTimeout() { + return stickinessTimeout; + } + + public void setStickinessTimeout(Integer stickinessTimeout) { + this.stickinessTimeout = stickinessTimeout; + } + + public HealthCheckConfig getHealthCheckConfig() { + return healthCheckConfig; + } + + public void setHealthCheckConfig(HealthCheckConfig healthCheckConfig) { + this.healthCheckConfig = healthCheckConfig; + } + + public String getForwardSrcIPMethod() { + return forwardSrcIPMethod; + } + + public void setForwardSrcIPMethod(String forwardSrcIPMethod) { + this.forwardSrcIPMethod = forwardSrcIPMethod; + } + + public static class HealthCheckConfig extends Request { + + /** 是否开启健康检查功能。暂时不支持关闭,默认 true */ + @UCloudParam("Enabled") + private Boolean enabled; + + /** 健康检查探测端口 说明: 限定取值:[1-65535] */ + @UCloudParam("Port") + private Integer port; + + /** 健康检查方式 限定取值:"Port"/"UDP"/"Ping" 默认值:“Port” */ + @UCloudParam("Type") + private String type; + + /** UDP" 检查模式的请求字符串 */ + @UCloudParam("ReqMsg") + private String reqMsg; + + /** "UDP" 检查模式的预期响应字符串 */ + @UCloudParam("ResMsg") + private String resMsg; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getReqMsg() { + return reqMsg; + } + + public void setReqMsg(String reqMsg) { + this.reqMsg = reqMsg; + } + + public String getResMsg() { + return resMsg; + } + + public void setResMsg(String resMsg) { + this.resMsg = resMsg; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerResponse.java new file mode 100644 index 00000000..7f9c0929 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNLBListenerResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateNLBListenerResponse extends Response { + + /** 监听器的ID */ + @SerializedName("ListenerId") + private String listenerId; + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerRequest.java new file mode 100644 index 00000000..fa48e8f7 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerRequest.java @@ -0,0 +1,172 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class CreateNetworkLoadBalancerRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 载均衡实例所属的VPC资源ID */ + @NotEmpty + @UCloudParam("VPCId") + private String vpcId; + + /** 负载均衡实例所属的子网资源ID */ + @NotEmpty + @UCloudParam("SubnetId") + private String subnetId; + + /** API 版本,限定取值 "v1.0"/"v2.0",默认值:"v2.0" */ + @UCloudParam("ApiVersion") + private String apiVersion; + + /** 负载均衡实例所属的业务组ID */ + @UCloudParam("Tag") + private String tag; + + /** 负载均衡实例的名称 限定字符长度:[1-255] 限定特殊字符,仅支持:-_. 默认值:nlb */ + @UCloudParam("Name") + private String name; + + /** 负载均衡实例的备注信息 限定字符长度:[0-255] */ + @UCloudParam("Remark") + private String remark; + + /** 负载均衡实例的IP协议,限定取值:"IPv4"/"IPv6"/"DualStack",默认值:"IPv4" */ + @UCloudParam("IPVersion") + private String ipVersion; + + /** 付费模式,限定取值:"Dynamic"/"Month"/"Year" */ + @UCloudParam("ChargeType") + private String chargeType; + + /** 购买的时长,ChargeType = "Month",Quantity = 0 代表购买到月底,其余情况必须赋值 */ + @UCloudParam("Quantity") + private Integer quantity; + + /** 代金券code */ + @UCloudParam("CouponId") + private String couponId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getApiVersion() { + return apiVersion; + } + + public void setApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getIPVersion() { + return ipVersion; + } + + public void setIPVersion(String ipVersion) { + this.ipVersion = ipVersion; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public String getCouponId() { + return couponId; + } + + public void setCouponId(String couponId) { + this.couponId = couponId; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerResponse.java new file mode 100644 index 00000000..ad91d9bb --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/CreateNetworkLoadBalancerResponse.java @@ -0,0 +1,34 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +public class CreateNetworkLoadBalancerResponse extends Response { + + /** 返回的NLBId */ + @SerializedName("NLBId") + private String nlbId; + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerRequest.java new file mode 100644 index 00000000..04543ae9 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerRequest.java @@ -0,0 +1,76 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteNLBListenerRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的ID */ + @NotEmpty + @UCloudParam("ListenerId") + private String listenerId; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerResponse.java new file mode 100644 index 00000000..c76d5f8c --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNLBListenerResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteNLBListenerResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerRequest.java new file mode 100644 index 00000000..f877bc54 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DeleteNetworkLoadBalancerRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 删除NLB时释放绑定的EIP */ + @UCloudParam("ReleaseEIP") + private Boolean releaseEIP; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public Boolean getReleaseEIP() { + return releaseEIP; + } + + public void setReleaseEIP(Boolean releaseEIP) { + this.releaseEIP = releaseEIP; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerResponse.java new file mode 100644 index 00000000..8c753dd2 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DeleteNetworkLoadBalancerResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class DeleteNetworkLoadBalancerResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersRequest.java new file mode 100644 index 00000000..41c3c6c1 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersRequest.java @@ -0,0 +1,99 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class DescribeNLBListenersRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID。未指定 ListenerId ,则描述指定的 LoadBalancerId 下的所有监听器 */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的ID */ + @UCloudParam("ListenerId") + private String listenerId; + + /** 限制返回的监听器数量 */ + @UCloudParam("Limit") + private Integer limit; + + /** 设置监听器的偏移量 */ + @UCloudParam("Offset") + private String offset; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getOffset() { + return offset; + } + + public void setOffset(String offset) { + this.offset = offset; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersResponse.java new file mode 100644 index 00000000..e5de692c --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNLBListenersResponse.java @@ -0,0 +1,442 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DescribeNLBListenersResponse extends Response { + + /** 全部个数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 返回的监听器列表 */ + @SerializedName("Listeners") + private List listeners; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getListeners() { + return listeners; + } + + public void setListeners(List listeners) { + this.listeners = listeners; + } + + public static class HealthCheckConfig extends Response { + + /** 是否开启健康检查功能。 */ + @SerializedName("Enabled") + private Boolean enabled; + + /** 健康检查探测端口 说明: 限定取值:[1-65535] */ + @SerializedName("Port") + private Integer port; + + /** 健康检查方式 限定取值:"Port"/"UDP"/"Ping" /"HTTP" 默认值:“Port” */ + @SerializedName("Type") + private String type; + + /** 健康检查间隔时间 限定取值:[1-60] 单位秒 默认 2s */ + @SerializedName("Interval") + private Integer interval; + + /** 健康检查最小成功数 限定取值:[1-10] 默认 3 */ + @SerializedName("MinSuccess") + private Integer minSuccess; + + /** 健康检查最大失败数 限定取值:[1-10] 默认 3 */ + @SerializedName("MaxFail") + private Integer maxFail; + + /** UDP" 检查模式的请求字符串 "HTTP" 检查模式的请求 json 字符串 */ + @SerializedName("ReqMsg") + private String reqMsg; + + /** "UDP" 检查模式的预期响应字符串 "HTTP" 检查模式的响应状态码 */ + @SerializedName("ResMsg") + private String resMsg; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getInterval() { + return interval; + } + + public void setInterval(Integer interval) { + this.interval = interval; + } + + public Integer getMinSuccess() { + return minSuccess; + } + + public void setMinSuccess(Integer minSuccess) { + this.minSuccess = minSuccess; + } + + public Integer getMaxFail() { + return maxFail; + } + + public void setMaxFail(Integer maxFail) { + this.maxFail = maxFail; + } + + public String getReqMsg() { + return reqMsg; + } + + public void setReqMsg(String reqMsg) { + this.reqMsg = reqMsg; + } + + public String getResMsg() { + return resMsg; + } + + public void setResMsg(String resMsg) { + this.resMsg = resMsg; + } + } + + public static class Listener extends Response { + + /** 监听器的ID */ + @SerializedName("ListenerId") + private String listenerId; + + /** 监听器的名称 */ + @SerializedName("Name") + private String name; + + /** 监听器的备注信息 */ + @SerializedName("Remark") + private String remark; + + /** 端口范围的起始端口 */ + @SerializedName("StartPort") + private Integer startPort; + + /** 端口范围的结束端口 */ + @SerializedName("EndPort") + private Integer endPort; + + /** 监听协议,限定取值:"TCP"/"UDP" */ + @SerializedName("Protocol") + private String protocol; + + /** + * 负载均衡算法,限定取值:"RoundRobin"/"SourceHash"/"LeastConn"/"WeightLeastConn "/"WeightRoundRobin " + */ + @SerializedName("Scheduler") + private String scheduler; + + /** 会话保持超时时间。单位:秒,0表示不开启会话保持 */ + @SerializedName("StickinessTimeout") + private Integer stickinessTimeout; + + /** 传递源 IP 方法。限定取值:"" / "None" / "Toa",空字符串和 None 代表关闭。 */ + @SerializedName("ForwardSrcIPMethod") + private String forwardSrcIPMethod; + + /** 健康检查相关配置 */ + @SerializedName("HealthCheckConfig") + private HealthCheckConfig healthCheckConfig; + + /** 服务节点信息 */ + @SerializedName("Targets") + private List targets; + + /** listener 健康状态,"Healthy"/"Unhealthy"/"PartialHealth"/"None" */ + @SerializedName("State") + private String state; + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getStartPort() { + return startPort; + } + + public void setStartPort(Integer startPort) { + this.startPort = startPort; + } + + public Integer getEndPort() { + return endPort; + } + + public void setEndPort(Integer endPort) { + this.endPort = endPort; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getScheduler() { + return scheduler; + } + + public void setScheduler(String scheduler) { + this.scheduler = scheduler; + } + + public Integer getStickinessTimeout() { + return stickinessTimeout; + } + + public void setStickinessTimeout(Integer stickinessTimeout) { + this.stickinessTimeout = stickinessTimeout; + } + + public String getForwardSrcIPMethod() { + return forwardSrcIPMethod; + } + + public void setForwardSrcIPMethod(String forwardSrcIPMethod) { + this.forwardSrcIPMethod = forwardSrcIPMethod; + } + + public HealthCheckConfig getHealthCheckConfig() { + return healthCheckConfig; + } + + public void setHealthCheckConfig(HealthCheckConfig healthCheckConfig) { + this.healthCheckConfig = healthCheckConfig; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + } + + public static class Target extends Response { + + /** 服务节点所在地域 */ + @SerializedName("Region") + private String region; + + /** 服务节点的类型 */ + @SerializedName("ResourceType") + private String resourceType; + + /** 服务节点的资源ID。在非IP类型时,必传 */ + @SerializedName("ResourceId") + private String resourceId; + + /** 服务节点的资源名称 */ + @SerializedName("ResourceName") + private String resourceName; + + /** 服务节点的VPC资源ID。在IP类型时,必传 */ + @SerializedName("VPCId") + private String vpcId; + + /** 服务节点的子网资源ID。在IP类型时,必传 */ + @SerializedName("SubnetId") + private String subnetId; + + /** 服务节点的IP。在IP类型时,必传 */ + @SerializedName("ResourceIP") + private String resourceIP; + + /** 服务节点的端口 */ + @SerializedName("Port") + private Integer port; + + /** 服务节点的权重。支持更新 */ + @SerializedName("Weight") + private Integer weight; + + /** 服务节点是否开启 */ + @SerializedName("Enabled") + private Boolean enabled; + + /** 服务节点的标识 ID 说明: 添加服务节点的时候无需传 更新服务节点属性时必传 */ + @SerializedName("Id") + private String id; + + /** 服务节点的健康检查状态 说明: 描述服务节点信息时显示 限定枚举值:"Healthy"/"Unhealthy" */ + @SerializedName("State") + private String state; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getResourceIP() { + return resourceIP; + } + + public void setResourceIP(String resourceIP) { + this.resourceIP = resourceIP; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersRequest.java new file mode 100644 index 00000000..d39ae1a2 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersRequest.java @@ -0,0 +1,135 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class DescribeNetworkLoadBalancersRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的转发类型 */ + @UCloudParam("ForwardingMode") + private String forwardingMode; + + /** 是否获取监听器和后端服务节点的详细信息 */ + @UCloudParam("ShowDetail") + private Boolean showDetail; + + /** 负载均衡实例的ID,数组 */ + @UCloudParam("NLBIds") + private List nlbIds; + + /** 限定所在的VPC */ + @UCloudParam("VPCId") + private String vpcId; + + /** 限定所在的子网 */ + @UCloudParam("SubnetId") + private String subnetId; + + /** 数据偏移量,默认为0 */ + @UCloudParam("Offset") + private Integer offset; + + /** 数据分页值,默认为100 */ + @UCloudParam("Limit") + private Integer limit; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getForwardingMode() { + return forwardingMode; + } + + public void setForwardingMode(String forwardingMode) { + this.forwardingMode = forwardingMode; + } + + public Boolean getShowDetail() { + return showDetail; + } + + public void setShowDetail(Boolean showDetail) { + this.showDetail = showDetail; + } + + public List getNLBIds() { + return nlbIds; + } + + public void setNLBIds(List nlbIds) { + this.nlbIds = nlbIds; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersResponse.java new file mode 100644 index 00000000..17d9918c --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/DescribeNetworkLoadBalancersResponse.java @@ -0,0 +1,727 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class DescribeNetworkLoadBalancersResponse extends Response { + + /** 满足条件的负载均衡实例总数 */ + @SerializedName("TotalCount") + private Integer totalCount; + + /** 返回的负载均衡实例列表 */ + @SerializedName("NLBs") + private List nlBs; + + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getNLBs() { + return nlBs; + } + + public void setNLBs(List nlBs) { + this.nlBs = nlBs; + } + + public static class HealthCheckConfig extends Response { + + /** 是否开启健康检查功能。 */ + @SerializedName("Enabled") + private Boolean enabled; + + /** 健康检查探测端口 说明: 限定取值:[1-65535] */ + @SerializedName("Port") + private Integer port; + + /** 健康检查方式 限定取值:"Port"/"UDP"/"Ping" /"HTTP" 默认值:“Port” */ + @SerializedName("Type") + private String type; + + /** 健康检查间隔时间 限定取值:[1-60] 单位秒 默认 2s */ + @SerializedName("Interval") + private Integer interval; + + /** 健康检查最小成功数 限定取值:[1-10] 默认 3 */ + @SerializedName("MinSuccess") + private Integer minSuccess; + + /** 健康检查最大失败数 限定取值:[1-10] 默认 3 */ + @SerializedName("MaxFail") + private Integer maxFail; + + /** UDP" 检查模式的请求字符串 "HTTP" 检查模式的请求 json 字符串 */ + @SerializedName("ReqMsg") + private String reqMsg; + + /** "UDP" 检查模式的预期响应字符串 "HTTP" 检查模式的响应状态码 */ + @SerializedName("ResMsg") + private String resMsg; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getInterval() { + return interval; + } + + public void setInterval(Integer interval) { + this.interval = interval; + } + + public Integer getMinSuccess() { + return minSuccess; + } + + public void setMinSuccess(Integer minSuccess) { + this.minSuccess = minSuccess; + } + + public Integer getMaxFail() { + return maxFail; + } + + public void setMaxFail(Integer maxFail) { + this.maxFail = maxFail; + } + + public String getReqMsg() { + return reqMsg; + } + + public void setReqMsg(String reqMsg) { + this.reqMsg = reqMsg; + } + + public String getResMsg() { + return resMsg; + } + + public void setResMsg(String resMsg) { + this.resMsg = resMsg; + } + } + + public static class IPInfo extends Response { + + /** 唯一标识 ID */ + @SerializedName("Id") + private String id; + + /** IP 地址 */ + @SerializedName("IP") + private String ip; + + /** IP 类型,1(前向 IP)/ 2(后向 IP) */ + @SerializedName("Type") + private Integer type; + + /** IP协议版本,限定枚举值:"IPv4" / "IPv6" */ + @SerializedName("IPVersion") + private String ipVersion; + + /** 网络模式,限定枚举值:"Internet" / "Intranet" */ + @SerializedName("AddressType") + private String addressType; + + /** + * 外网IP的运营商信息,限定枚举值:"Telecom" / + * "Unicom"/"International"/"Bgp"/"Duplet"/"BGPPro"/"China-mobile"/"Anycast" + */ + @SerializedName("OperatorName") + private String operatorName; + + /** 带宽类型,限定枚举值:0(普通带宽)/ 1(共享带宽) */ + @SerializedName("BandwidthType") + private Integer bandwidthType; + + /** 带宽值。单位 M */ + @SerializedName("Bandwidth") + private Integer bandwidth; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIP() { + return ip; + } + + public void setIP(String ip) { + this.ip = ip; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getIPVersion() { + return ipVersion; + } + + public void setIPVersion(String ipVersion) { + this.ipVersion = ipVersion; + } + + public String getAddressType() { + return addressType; + } + + public void setAddressType(String addressType) { + this.addressType = addressType; + } + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + + public Integer getBandwidthType() { + return bandwidthType; + } + + public void setBandwidthType(Integer bandwidthType) { + this.bandwidthType = bandwidthType; + } + + public Integer getBandwidth() { + return bandwidth; + } + + public void setBandwidth(Integer bandwidth) { + this.bandwidth = bandwidth; + } + } + + public static class Listener extends Response { + + /** 监听器的ID */ + @SerializedName("ListenerId") + private String listenerId; + + /** 监听器的名称 */ + @SerializedName("Name") + private String name; + + /** 监听器的备注信息 */ + @SerializedName("Remark") + private String remark; + + /** 端口范围的起始端口 */ + @SerializedName("StartPort") + private Integer startPort; + + /** 端口范围的结束端口 */ + @SerializedName("EndPort") + private Integer endPort; + + /** 监听协议,限定取值:"TCP"/"UDP" */ + @SerializedName("Protocol") + private String protocol; + + /** + * 负载均衡算法,限定取值:"RoundRobin"/"SourceHash"/"LeastConn"/"WeightLeastConn "/"WeightRoundRobin " + */ + @SerializedName("Scheduler") + private String scheduler; + + /** 会话保持超时时间。单位:秒,0表示不开启会话保持 */ + @SerializedName("StickinessTimeout") + private Integer stickinessTimeout; + + /** 传递源 IP 方法。限定取值:"" / "None" / "Toa",空字符串和 None 代表关闭。 */ + @SerializedName("ForwardSrcIPMethod") + private String forwardSrcIPMethod; + + /** 健康检查相关配置 */ + @SerializedName("HealthCheckConfig") + private HealthCheckConfig healthCheckConfig; + + /** 服务节点信息 */ + @SerializedName("Targets") + private List targets; + + /** listener 健康状态,"Healthy"/"Unhealthy"/"PartialHealth"/"None" */ + @SerializedName("State") + private String state; + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getStartPort() { + return startPort; + } + + public void setStartPort(Integer startPort) { + this.startPort = startPort; + } + + public Integer getEndPort() { + return endPort; + } + + public void setEndPort(Integer endPort) { + this.endPort = endPort; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getScheduler() { + return scheduler; + } + + public void setScheduler(String scheduler) { + this.scheduler = scheduler; + } + + public Integer getStickinessTimeout() { + return stickinessTimeout; + } + + public void setStickinessTimeout(Integer stickinessTimeout) { + this.stickinessTimeout = stickinessTimeout; + } + + public String getForwardSrcIPMethod() { + return forwardSrcIPMethod; + } + + public void setForwardSrcIPMethod(String forwardSrcIPMethod) { + this.forwardSrcIPMethod = forwardSrcIPMethod; + } + + public HealthCheckConfig getHealthCheckConfig() { + return healthCheckConfig; + } + + public void setHealthCheckConfig(HealthCheckConfig healthCheckConfig) { + this.healthCheckConfig = healthCheckConfig; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + } + + public static class NetworkLoadBalancer extends Response { + + /** 负载均衡实例的ID */ + @SerializedName("NLBId") + private String nlbId; + + /** 负载均衡实例的名称 */ + @SerializedName("Name") + private String name; + + /** 负载均衡实例所属的业务组ID */ + @SerializedName("Tag") + private String tag; + + /** 负载均衡实例的备注信息 */ + @SerializedName("Remark") + private String remark; + + /** 负载均衡实例支持的IP协议版本 */ + @SerializedName("IPVersion") + private String ipVersion; + + /** 负载均衡实例所属的VPC资源ID */ + @SerializedName("VPCId") + private String vpcId; + + /** 负载均衡实例所属的子网资源ID */ + @SerializedName("SubnetId") + private String subnetId; + + /** 绑定的IP信息 */ + @SerializedName("IPInfos") + private List ipInfos; + + /** 负载均衡实例的转发模式 */ + @SerializedName("ForwardingMode") + private String forwardingMode; + + /** 付费模式 */ + @SerializedName("ChargeType") + private String chargeType; + + /** 有效期(计费) */ + @SerializedName("PurchaseValue") + private Integer purchaseValue; + + /** 负载均衡实例创建时间。格式为 Unix Timestamp */ + @SerializedName("CreateTime") + private Integer createTime; + + /** */ + @SerializedName("Listeners") + private List listeners; + + /** NLB 状态:Normal-正常;Closed-欠费停服;Deleted 已删除 */ + @SerializedName("Status") + private String status; + + /** 是否开启自动续费 */ + @SerializedName("AutoRenewEnabled") + private Boolean autoRenewEnabled; + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getIPVersion() { + return ipVersion; + } + + public void setIPVersion(String ipVersion) { + this.ipVersion = ipVersion; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public List getIPInfos() { + return ipInfos; + } + + public void setIPInfos(List ipInfos) { + this.ipInfos = ipInfos; + } + + public String getForwardingMode() { + return forwardingMode; + } + + public void setForwardingMode(String forwardingMode) { + this.forwardingMode = forwardingMode; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Integer getPurchaseValue() { + return purchaseValue; + } + + public void setPurchaseValue(Integer purchaseValue) { + this.purchaseValue = purchaseValue; + } + + public Integer getCreateTime() { + return createTime; + } + + public void setCreateTime(Integer createTime) { + this.createTime = createTime; + } + + public List getListeners() { + return listeners; + } + + public void setListeners(List listeners) { + this.listeners = listeners; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Boolean getAutoRenewEnabled() { + return autoRenewEnabled; + } + + public void setAutoRenewEnabled(Boolean autoRenewEnabled) { + this.autoRenewEnabled = autoRenewEnabled; + } + } + + public static class Target extends Response { + + /** 服务节点所在地域 */ + @SerializedName("Region") + private String region; + + /** 服务节点的类型 */ + @SerializedName("ResourceType") + private String resourceType; + + /** 服务节点的资源ID。在非IP类型时,必传 */ + @SerializedName("ResourceId") + private String resourceId; + + /** 服务节点的资源名称 */ + @SerializedName("ResourceName") + private String resourceName; + + /** 服务节点的VPC资源ID。在IP类型时,必传 */ + @SerializedName("VPCId") + private String vpcId; + + /** 服务节点的子网资源ID。在IP类型时,必传 */ + @SerializedName("SubnetId") + private String subnetId; + + /** 服务节点的IP。在IP类型时,必传 */ + @SerializedName("ResourceIP") + private String resourceIP; + + /** 服务节点的端口 */ + @SerializedName("Port") + private Integer port; + + /** 服务节点的权重。支持更新 */ + @SerializedName("Weight") + private Integer weight; + + /** 服务节点是否开启 */ + @SerializedName("Enabled") + private Boolean enabled; + + /** 服务节点的标识 ID 说明: 添加服务节点的时候无需传 更新服务节点属性时必传 */ + @SerializedName("Id") + private String id; + + /** 服务节点的健康检查状态 说明: 描述服务节点信息时显示 限定枚举值:"Healthy"/"Unhealthy" */ + @SerializedName("State") + private String state; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + public String getVPCId() { + return vpcId; + } + + public void setVPCId(String vpcId) { + this.vpcId = vpcId; + } + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getResourceIP() { + return resourceIP; + } + + public void setResourceIP(String resourceIP) { + this.resourceIP = resourceIP; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceRequest.java new file mode 100644 index 00000000..1caef896 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceRequest.java @@ -0,0 +1,86 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class GetNetworkLoadBalancerPriceRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 付费模式 限定枚举值:"Year" / "Month"/ "Dynamic" 默认获取三种价格 */ + @UCloudParam("ChargeType") + private String chargeType; + + /** 负载均衡实例计费方式 限定枚举值:"Instance" / "LCU" 默认值:"Instance" */ + @UCloudParam("PayMode") + private String payMode; + + /** 购买时长 按小时购买(Dynamic)时无需此参数。月付时,此参数传 0,代表了购买至月末 默认 1 */ + @UCloudParam("Quantity") + private Integer quantity; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceResponse.java new file mode 100644 index 00000000..359f1153 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/GetNetworkLoadBalancerPriceResponse.java @@ -0,0 +1,98 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.response.Response; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class GetNetworkLoadBalancerPriceResponse extends Response { + + /** */ + @SerializedName("Prices") + private List prices; + + public List getPrices() { + return prices; + } + + public void setPrices(List prices) { + this.prices = prices; + } + + public static class PriceDetail extends Response { + + /** 负载均衡付费方式 */ + @SerializedName("ChargeType") + private String chargeType; + + /** 购买负载均衡的实际价格,单位“元” */ + @SerializedName("Price") + private Double price; + + /** 用户折后价,单位“元”。CustomPrice=OriginalPrice*用户折扣 */ + @SerializedName("CustomPrice") + private Double customPrice; + + /** 购买负载均衡的原价,单位“元” */ + @SerializedName("OriginalPrice") + private Double originalPrice; + + /** 资源有效期,以Unix Timestamp表示 */ + @SerializedName("PurchaseValue") + private Integer purchaseValue; + + public String getChargeType() { + return chargeType; + } + + public void setChargeType(String chargeType) { + this.chargeType = chargeType; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + public Double getCustomPrice() { + return customPrice; + } + + public void setCustomPrice(Double customPrice) { + this.customPrice = customPrice; + } + + public Double getOriginalPrice() { + return originalPrice; + } + + public void setOriginalPrice(Double originalPrice) { + this.originalPrice = originalPrice; + } + + public Integer getPurchaseValue() { + return purchaseValue; + } + + public void setPurchaseValue(Integer purchaseValue) { + this.purchaseValue = purchaseValue; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsRequest.java new file mode 100644 index 00000000..df1f2121 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsRequest.java @@ -0,0 +1,90 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class RemoveNLBTargetsRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的ID */ + @NotEmpty + @UCloudParam("ListenerId") + private String listenerId; + + /** 服务节点的标识ID。单次请求不能超过 40 个 */ + @NotEmpty + @UCloudParam("Ids") + private List ids; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public List getIds() { + return ids; + } + + public void setIds(List ids) { + this.ids = ids; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsResponse.java new file mode 100644 index 00000000..71d6f142 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/RemoveNLBTargetsResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class RemoveNLBTargetsResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeRequest.java new file mode 100644 index 00000000..53ff9c96 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeRequest.java @@ -0,0 +1,238 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class UpdateNLBListenerAttributeRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("ListenerId") + private String listenerId; + + /** 监听器的名称 */ + @UCloudParam("Name") + private String name; + + /** 监听器的备注信息 */ + @UCloudParam("Remark") + private String remark; + + /** 端口范围的起始端口 限定取值:[1-65535] 默认值 1,只有全端口模式支持修改 */ + @UCloudParam("StartPort") + private Integer startPort; + + /** 端口范围的结束端口 限定取值:[1-65535] 取值不小于起始端口 默认值 65535,只有全端口模式支持修改 */ + @UCloudParam("EndPort") + private Integer endPort; + + /** + * 负载均衡算法 限定取值:"RoundRobin"/"SourceHash"/"LeastConn"/"WeightLeastConn "/"WeightRoundRobin" 默认值 + * "RoundRobin" + */ + @UCloudParam("Scheduler") + private String scheduler; + + /** 会话保持超时时间。单位:秒 说明: 限定取值:[60-900],0 表示不开启会话保持 默认值60 */ + @UCloudParam("StickinessTimeout") + private Integer stickinessTimeout; + + /** 传递源 IP 方法。限定取值:"" / "None" / "Toa",空字符串和 None 代表关闭。 */ + @UCloudParam("ForwardSrcIPMethod") + private String forwardSrcIPMethod; + + /** */ + @UCloudParam("HealthCheckConfig") + private HealthCheckConfig healthCheckConfig; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Integer getStartPort() { + return startPort; + } + + public void setStartPort(Integer startPort) { + this.startPort = startPort; + } + + public Integer getEndPort() { + return endPort; + } + + public void setEndPort(Integer endPort) { + this.endPort = endPort; + } + + public String getScheduler() { + return scheduler; + } + + public void setScheduler(String scheduler) { + this.scheduler = scheduler; + } + + public Integer getStickinessTimeout() { + return stickinessTimeout; + } + + public void setStickinessTimeout(Integer stickinessTimeout) { + this.stickinessTimeout = stickinessTimeout; + } + + public String getForwardSrcIPMethod() { + return forwardSrcIPMethod; + } + + public void setForwardSrcIPMethod(String forwardSrcIPMethod) { + this.forwardSrcIPMethod = forwardSrcIPMethod; + } + + public HealthCheckConfig getHealthCheckConfig() { + return healthCheckConfig; + } + + public void setHealthCheckConfig(HealthCheckConfig healthCheckConfig) { + this.healthCheckConfig = healthCheckConfig; + } + + public static class HealthCheckConfig extends Request { + + /** 是否开启健康检查功能。暂时不支持关闭,默认 true */ + @UCloudParam("Enabled") + private Boolean enabled; + + /** 健康检查探测端口 说明: 限定取值:[1-65535] */ + @UCloudParam("Port") + private Integer port; + + /** 健康检查方式 限定取值:"Port"/"UDP"/"Ping" 默认值:“Port” */ + @UCloudParam("Type") + private String type; + + /** UDP" 检查模式的请求字符串 */ + @UCloudParam("ReqMsg") + private String reqMsg; + + /** "UDP" 检查模式的预期响应字符串 */ + @UCloudParam("ResMsg") + private String resMsg; + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getPort() { + return port; + } + + public void setPort(Integer port) { + this.port = port; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getReqMsg() { + return reqMsg; + } + + public void setReqMsg(String reqMsg) { + this.reqMsg = reqMsg; + } + + public String getResMsg() { + return resMsg; + } + + public void setResMsg(String resMsg) { + this.resMsg = resMsg; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeResponse.java new file mode 100644 index 00000000..222062e7 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBListenerAttributeResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class UpdateNLBListenerAttributeResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeRequest.java new file mode 100644 index 00000000..a0adcc45 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeRequest.java @@ -0,0 +1,128 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +import java.util.List; + +public class UpdateNLBTargetsAttributeRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 监听器的ID */ + @NotEmpty + @UCloudParam("ListenerId") + private String listenerId; + + /** */ + @UCloudParam("Targets") + private List targets; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getListenerId() { + return listenerId; + } + + public void setListenerId(String listenerId) { + this.listenerId = listenerId; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } + + public static class Targets extends Request { + + /** 服务节点的ID */ + @UCloudParam("Id") + private String id; + + /** 是否禁用服务节点 */ + @UCloudParam("Enabled") + private Boolean enabled; + + /** 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询、加权最小连接数算法时有效 */ + @UCloudParam("Weight") + private Integer weight; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeResponse.java new file mode 100644 index 00000000..93eb8b35 --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNLBTargetsAttributeResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class UpdateNLBTargetsAttributeResponse extends Response {} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeRequest.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeRequest.java new file mode 100644 index 00000000..d5cc1f0e --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeRequest.java @@ -0,0 +1,99 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + +import cn.ucloud.common.annotation.NotEmpty; +import cn.ucloud.common.annotation.UCloudParam; +import cn.ucloud.common.request.Request; + +public class UpdateNetworkLoadBalancerAttributeRequest extends Request { + + /** 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) */ + @NotEmpty + @UCloudParam("Region") + private String region; + + /** + * 项目ID。不填写为默认项目,子帐号必须填写。 + * 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + */ + @UCloudParam("ProjectId") + private String projectId; + + /** 负载均衡实例的ID */ + @NotEmpty + @UCloudParam("NLBId") + private String nlbId; + + /** 负载均衡实例的名称 */ + @UCloudParam("Name") + private String name; + + /** 负载均衡实例所属的业务组ID */ + @UCloudParam("Tag") + private String tag; + + /** 负载均衡实例的备注信息 */ + @UCloudParam("Remark") + private String remark; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getNLBId() { + return nlbId; + } + + public void setNLBId(String nlbId) { + this.nlbId = nlbId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeResponse.java b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeResponse.java new file mode 100644 index 00000000..9278405e --- /dev/null +++ b/ucloud-sdk-java-nlb/src/main/java/cn/ucloud/nlb/models/UpdateNetworkLoadBalancerAttributeResponse.java @@ -0,0 +1,20 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.nlb.models; + + + +import cn.ucloud.common.response.Response; + +public class UpdateNetworkLoadBalancerAttributeResponse extends Response {} diff --git a/ucloud-sdk-java-ocr/pom.xml b/ucloud-sdk-java-ocr/pom.xml deleted file mode 100644 index 8880d3e5..00000000 --- a/ucloud-sdk-java-ocr/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - ucloud-sdk-java - cn.ucloud - 0.8.4.4-release - - - 4.0.0 - 0.8.4.4-release - ucloud-sdk-java-ocr - - - - cn.ucloud - ucloud-sdk-java-common - 0.8.4.4-release - - - - - org.hibernate - hibernate-validator - - - - junit - junit - test - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-simple - provided - - - - org.skyscreamer - jsonassert - test - - - - \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/DefaultOcrClient.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/DefaultOcrClient.java deleted file mode 100644 index e538c443..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/DefaultOcrClient.java +++ /dev/null @@ -1,179 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.client.DefaultUcloudClient; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.http.UcloudHttp; -import cn.ucloud.common.http.UcloudHttpImpl; -import cn.ucloud.common.pojo.UcloudConfig; -import cn.ucloud.ocr.model.CreateUAIOcrResourceParam; -import cn.ucloud.ocr.model.CreateUAIOcrResourceResult; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceParam; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceResult; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeParam; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeResult; -import cn.ucloud.ocr.model.GetUAIOcrResourceListParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceListResult; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoResult; - -/** - * @Description : 默认ocr 客户端 - * @Author : codezhang - * @Date : 2019-04-19 15:25 - **/ -public class DefaultOcrClient extends DefaultUcloudClient implements OcrClient { - - public DefaultOcrClient(UcloudConfig config) { - super(config); - } - - @Override - public DeleteUAIOcrResourceResult - deleteUAIOcrResource(DeleteUAIOcrResourceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteUAIOcrResourceResult.class); - return (DeleteUAIOcrResourceResult) http.doPost(param, config, null); - } - - @Override - public void deleteUAIOcrResource(DeleteUAIOcrResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteUAIOcrResourceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAIOcrResourceRecordInfoResult - getUAIOcrResourceRecordInfo(GetUAIOcrResourceRecordInfoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrResourceRecordInfoResult.class); - return (GetUAIOcrResourceRecordInfoResult) http.doPost(param, config, null); - } - - @Override - public void getUAIOcrResourceRecordInfo(GetUAIOcrResourceRecordInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrResourceRecordInfoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAIOcrResourceOssInfoResult - modifyUAIOcrResourceOssInfo(ModifyUAIOcrResourceOssInfoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceOssInfoResult.class); - return (ModifyUAIOcrResourceOssInfoResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAIOcrResourceOssInfo(ModifyUAIOcrResourceOssInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceOssInfoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAIOcrResourceNameResult - modifyUAIOcrResourceName(ModifyUAIOcrResourceNameParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceNameResult.class); - return (ModifyUAIOcrResourceNameResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAIOcrResourceName(ModifyUAIOcrResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceNameResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUAIOcrResourceMemoResult - modifyUAIOcrResourceMemo(ModifyUAIOcrResourceMemoParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceMemoResult.class); - return (ModifyUAIOcrResourceMemoResult) http.doPost(param, config, null); - } - - @Override - public void modifyUAIOcrResourceMemo(ModifyUAIOcrResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUAIOcrResourceMemoResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAIOcrResourceListResult - getUAIOcrResourceList(GetUAIOcrResourceListParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrResourceListResult.class); - return (GetUAIOcrResourceListResult) http.doPost(param, config, null); - } - - @Override - public void getUAIOcrResourceList(GetUAIOcrResourceListParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrResourceListResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateUAIOcrResourceResult createUAIOcrResource(CreateUAIOcrResourceParam param) - throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateUAIOcrResourceResult.class); - return (CreateUAIOcrResourceResult) http.doPost(param, config, null); - } - - @Override - public void createUAIOcrResource(CreateUAIOcrResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(CreateUAIOcrResourceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUAIOcrAvailResourceTypeResult - getUAIOcrAvailResourceType(GetUAIOcrAvailResourceTypeParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrAvailResourceTypeResult.class); - return (GetUAIOcrAvailResourceTypeResult) http.doPost(param, config, null); - } - - @Override - public void getUAIOcrAvailResourceType(GetUAIOcrAvailResourceTypeParam param, - UcloudHandler handler, - Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUAIOcrAvailResourceTypeResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/OcrClient.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/OcrClient.java deleted file mode 100644 index 37f733d4..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/client/OcrClient.java +++ /dev/null @@ -1,204 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.client.UcloudClient; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.ocr.model.CreateUAIOcrResourceParam; -import cn.ucloud.ocr.model.CreateUAIOcrResourceResult; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceParam; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceResult; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeParam; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeResult; -import cn.ucloud.ocr.model.GetUAIOcrResourceListParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceListResult; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoResult; - -/** - * @Description : ocr 客户端接口 - * @Author : codezhang - * @Date : 2019-04-19 15:24 - **/ -public interface OcrClient extends UcloudClient { - - /** - * 删除UAI-OCR资源 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteUAIOcrResourceResult - deleteUAIOcrResource(DeleteUAIOcrResourceParam param) throws Exception; - - /** - * 删除UAI-OCR资源 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteUAIOcrResource(DeleteUAIOcrResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取UAI-OCR资源请求记录 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAIOcrResourceRecordInfoResult - getUAIOcrResourceRecordInfo(GetUAIOcrResourceRecordInfoParam param) throws Exception; - - /** - * 获取UAI-OCR资源请求记录 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAIOcrResourceRecordInfo(GetUAIOcrResourceRecordInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 修改UAI-OCR资源对象存储信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAIOcrResourceOssInfoResult - modifyUAIOcrResourceOssInfo(ModifyUAIOcrResourceOssInfoParam param) throws Exception; - - /** - * 修改UAI-OCR资源对象存储信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAIOcrResourceOssInfo(ModifyUAIOcrResourceOssInfoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 修改UAI-OCR资源名称 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAIOcrResourceNameResult - modifyUAIOcrResourceName(ModifyUAIOcrResourceNameParam param) throws Exception; - - /** - * 修改UAI-OCR资源名称 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAIOcrResourceName(ModifyUAIOcrResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 修改UAI-OCR资源备注 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUAIOcrResourceMemoResult - modifyUAIOcrResourceMemo(ModifyUAIOcrResourceMemoParam param) throws Exception; - - /** - * 修改UAI-OCR资源备注 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUAIOcrResourceMemo(ModifyUAIOcrResourceMemoParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取UAI-OCR资源列表 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAIOcrResourceListResult - getUAIOcrResourceList(GetUAIOcrResourceListParam param) throws Exception; - - /** - * 获取UAI-OCR资源列表 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAIOcrResourceList(GetUAIOcrResourceListParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 创建UAI-OCR资源 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateUAIOcrResourceResult - createUAIOcrResource(CreateUAIOcrResourceParam param) throws Exception; - - /** - * 创建UAI-OCR资源 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createUAIOcrResource(CreateUAIOcrResourceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - - /** - * 获取可用UAI-OCR资源类型 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUAIOcrAvailResourceTypeResult - getUAIOcrAvailResourceType(GetUAIOcrAvailResourceTypeParam param) throws Exception; - - /** - * 获取可用UAI-OCR资源类型 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUAIOcrAvailResourceType(GetUAIOcrAvailResourceTypeParam param, - UcloudHandler handler, - Boolean... asyncFlag); - -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceParam.java deleted file mode 100644 index 1b84c9f7..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceParam.java +++ /dev/null @@ -1,114 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.exception.ValidatorException; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; -import com.google.gson.annotations.SerializedName; - -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - -/** - * @Description :创建UAI-OCR资源 - * @Author : codezhang - * @Date : 2019-04-19 15:26 - **/ -public class CreateUAIOcrResourceParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * OCR类型。可选类型通过GetUAIOcrAvailResourceType获取。 - */ - private List resourceTypeIds; - - /** - * 资源名称,默认资源名称AutoOcr-timestamp - */ - @SerializedName("ResourceName") - private String resourceName; - - /** - * 资源备注 - */ - @UcloudParam("ResourceMemo") - private String resourceMemo; - - public CreateUAIOcrResourceParam(@NotEmpty(message = "region can not be empty") String region, - List resourceTypeIds) { - super("CreateUAIOcrResource"); - this.region = region; - this.resourceTypeIds = resourceTypeIds; - } - - @UcloudParam("ResourceType") - public List checkResourceTypeIds() throws ValidatorException { - if (resourceTypeIds == null || resourceTypeIds.isEmpty()) { - throw new ValidatorException("resourceTypeIds is empty"); - } - List params = new ArrayList<>(); - int count = resourceTypeIds.size(); - for (int i = 0; i < count; i++) { - Integer id = resourceTypeIds.get(i); - if (id == null) { - throw new ValidatorException(String.format("resourceTypeIds.[%d] is null", i)); - } - Param param = new Param(String.format("ResourceType.%d", i), id); - params.add(param); - } - return params; - } - - public List getResourceTypeIds() { - return resourceTypeIds; - } - - public void setResourceTypeIds(List resourceTypeIds) { - this.resourceTypeIds = resourceTypeIds; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceResult.java deleted file mode 100644 index 4b35e2ac..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/CreateUAIOcrResourceResult.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -/** - * @Description :创建UAI-OCR资源 - * @Author : codezhang - * @Date : 2019-04-19 15:39 - **/ -public class CreateUAIOcrResourceResult extends BaseResponseResult { - - - /** - * 创建的资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceParam.java deleted file mode 100644 index fa6932c8..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceParam.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :删除UAI-OCR资源 - * @Author : codezhang - * @Date : 2019-04-19 16:38 - **/ -public class DeleteUAIOcrResourceParam extends BaseRequestParam { - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - public DeleteUAIOcrResourceParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "resourceId can not be empty") String resourceId) { - super("DeleteUAIOcrResource"); - this.region = region; - this.resourceId = resourceId; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceResult.java deleted file mode 100644 index 7451dca3..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/DeleteUAIOcrResourceResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :删除UAI-OCR资源 - * @Author : codezhang - * @Date : 2019-04-19 16:39 - **/ -public class DeleteUAIOcrResourceResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeParam.java deleted file mode 100644 index d15433fa..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :获取可用UAI-OCR资源类型 - * @Author : codezhang - * @Date : 2019-04-19 15:26 - **/ -public class GetUAIOcrAvailResourceTypeParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - public GetUAIOcrAvailResourceTypeParam(@NotEmpty(message = "region can not be empty") String region) { - super("GetUAIOcrAvailResourceType"); - this.region = region; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeResult.java deleted file mode 100644 index 697042b2..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrAvailResourceTypeResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : 获取可用UAI-OCR资源类型 - * @Author : codezhang - * @Date : 2019-04-19 15:28 - **/ -public class GetUAIOcrAvailResourceTypeResult extends BaseResponseResult { - - /** - * 可用资源类型总数 - */ - @SerializedName("TotalCount") - private Integer totalCount; - - /** - * OCR资源类型的具体信息 - */ - @SerializedName("DataSet") - private List uaiOcrResourceTypeInfos; - - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(Integer totalCount) { - this.totalCount = totalCount; - } - - public List getUaiOcrResourceTypeInfos() { - return uaiOcrResourceTypeInfos; - } - - public void setUaiOcrResourceTypeInfos(List uaiOcrResourceTypeInfos) { - this.uaiOcrResourceTypeInfos = uaiOcrResourceTypeInfos; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListParam.java deleted file mode 100644 index 07c79b58..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListParam.java +++ /dev/null @@ -1,77 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :获取UAI-OCR资源列表 - * @Author : codezhang - * @Date : 2019-04-19 15:44 - **/ -public class GetUAIOcrResourceListParam extends BaseRequestParam { - - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 查询限制条数,默认无限制 - */ - @UcloudParam("Limit") - private Integer limit; - - /** - * 查询起始偏移量,默认为0,仅在Limit非零时有效 - */ - @UcloudParam("Offset") - private Integer offset; - - public GetUAIOcrResourceListParam(@NotEmpty(message = "region can not be empty") String region) { - super("GetUAIOcrResourceList"); - this.region = region; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListResult.java deleted file mode 100644 index d2311aca..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceListResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description :获取UAI-OCR资源列表 - * @Author : codezhang - * @Date : 2019-04-19 15:46 - **/ -public class GetUAIOcrResourceListResult extends BaseResponseResult { - - /** - * 获取的资源总数 - */ - @SerializedName("TotalCount") - private Integer totalCount; - - /** - * UAI-OCR资源的具体信息 - */ - @SerializedName("DataSet") - private List uaiOcrResourceInfos; - - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(Integer totalCount) { - this.totalCount = totalCount; - } - - public List getUaiOcrResourceInfos() { - return uaiOcrResourceInfos; - } - - public void setUaiOcrResourceInfos(List uaiOcrResourceInfos) { - this.uaiOcrResourceInfos = uaiOcrResourceInfos; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoParam.java deleted file mode 100644 index 31e5cdc5..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoParam.java +++ /dev/null @@ -1,96 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** - * @Description :获取UAI-OCR资源请求记录 - * @Author : codezhang - * @Date : 2019-04-19 16:20 - **/ -public class GetUAIOcrResourceRecordInfoParam extends BaseRequestParam { - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 开始查询时间,Unix时间戳形式 - */ - @NotNull(message = "beginTime can not be null") - @UcloudParam("BeginTime") - private Long beginTime; - - /** - * 结束查询时间,Unix时间戳形式 - */ - @NotNull(message = "endTime can not be null") - @UcloudParam("EndTime") - private Long endTime; - - /** - * 资源ID - */ - @UcloudParam("ResourceId") - private String resourceId; - - public GetUAIOcrResourceRecordInfoParam(@NotEmpty(message = "region can not be empty") String region, - @NotNull(message = "beginTime can not be null") Long beginTime, - @NotNull(message = "endTime can not be null") Long endTime) { - super("GetUAIOcrResourceRecordInfo"); - this.region = region; - this.beginTime = beginTime; - this.endTime = endTime; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public Long getBeginTime() { - return beginTime; - } - - public void setBeginTime(Long beginTime) { - this.beginTime = beginTime; - } - - public Long getEndTime() { - return endTime; - } - - public void setEndTime(Long endTime) { - this.endTime = endTime; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoResult.java deleted file mode 100644 index b658634f..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/GetUAIOcrResourceRecordInfoResult.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description : 获取UAI-OCR资源请求记录 - * @Author : codezhang - * @Date : 2019-04-19 16:26 - **/ -public class GetUAIOcrResourceRecordInfoResult extends BaseResponseResult { - - /** - * 资源请求记录总数 - */ - @SerializedName("TotalRecordCount") - private Integer totalRecordCount; - - /** - * 记录的OCR请求总数 - */ - @SerializedName("TotalOcrCount") - private Integer totalOcrCount; - - /** - * 资源请求记录的具体信息 - */ - @SerializedName("DataSet") - private List uaiOcrResourceRecordInfos; - - public Integer getTotalRecordCount() { - return totalRecordCount; - } - - public void setTotalRecordCount(Integer totalRecordCount) { - this.totalRecordCount = totalRecordCount; - } - - public Integer getTotalOcrCount() { - return totalOcrCount; - } - - public void setTotalOcrCount(Integer totalOcrCount) { - this.totalOcrCount = totalOcrCount; - } - - public List getUaiOcrResourceRecordInfos() { - return uaiOcrResourceRecordInfos; - } - - public void setUaiOcrResourceRecordInfos(List uaiOcrResourceRecordInfos) { - this.uaiOcrResourceRecordInfos = uaiOcrResourceRecordInfos; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoParam.java deleted file mode 100644 index 6c846c9b..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoParam.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description : 修改UAI-OCR资源备注 - * @Author : codezhang - * @Date : 2019-04-19 16:00 - **/ -public class ModifyUAIOcrResourceMemoParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 待修改的资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的资源备注名称 - */ - @NotEmpty(message = "resourceMemo can not be empty") - @UcloudParam("ResourceMemo") - private String resourceMemo; - - public ModifyUAIOcrResourceMemoParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "resourceMemo can not be empty") String resourceMemo) { - super("ModifyUAIOcrResourceMemo"); - this.region = region; - this.resourceId = resourceId; - this.resourceMemo = resourceMemo; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoResult.java deleted file mode 100644 index 4a8f3061..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceMemoResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :修改UAI-OCR资源备注 - * @Author : codezhang - * @Date : 2019-04-19 16:02 - **/ -public class ModifyUAIOcrResourceMemoResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameParam.java deleted file mode 100644 index ca2c9279..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameParam.java +++ /dev/null @@ -1,82 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :修改UAI-OCR资源名称 - * @Author : codezhang - * @Date : 2019-04-19 16:08 - **/ -public class ModifyUAIOcrResourceNameParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 待修改的资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的资源名称 - */ - @NotEmpty(message = "resourceMemo can not be empty") - @UcloudParam("ResourceName") - private String resourceName; - - public ModifyUAIOcrResourceNameParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "resourceMemo can not be empty") String resourceName) { - super("ModifyUAIOcrResourceName"); - this.region = region; - this.resourceId = resourceId; - this.resourceName = resourceName; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameResult.java deleted file mode 100644 index d3126284..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceNameResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :修改UAI-OCR资源名称 - * @Author : codezhang - * @Date : 2019-04-19 16:10 - **/ -public class ModifyUAIOcrResourceNameResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoParam.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoParam.java deleted file mode 100644 index a57e85ad..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoParam.java +++ /dev/null @@ -1,99 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - -/** - * @Description :修改UAI-OCR资源对象存储信息 - * @Author : codezhang - * @Date : 2019-04-19 16:14 - **/ -public class ModifyUAIOcrResourceOssInfoParam extends BaseRequestParam { - - /** - * 地域。 参见 [地域和可用区列表] - */ - @NotEmpty(message = "region can not be empty") - @UcloudParam("Region") - private String region; - - /** - * 可用区。参见 [可用区列表] - */ - @UcloudParam("Zone") - private String zone; - - /** - * 待修改的资源ID - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - /** - * 修改后的对象存储公钥 - */ - @NotEmpty(message = "ossPublicKey can not be empty") - @UcloudParam("OssPublicKey") - private String ossPublicKey; - - /** - * 修改后的对象存储私钥 - */ - @NotEmpty(message = "ossPrivateKey can not be empty") - @UcloudParam("OssPrivateKey") - private String ossPrivateKey; - - public ModifyUAIOcrResourceOssInfoParam(@NotEmpty(message = "region can not be empty") String region, - @NotEmpty(message = "resourceId can not be empty") String resourceId, - @NotEmpty(message = "ossPublicKey can not be empty") String ossPublicKey, - @NotEmpty(message = "ossPrivateKey can not be empty") String ossPrivateKey) { - super("ModifyUAIOcrResourceOssInfo"); - this.region = region; - this.resourceId = resourceId; - this.ossPublicKey = ossPublicKey; - this.ossPrivateKey = ossPrivateKey; - } - - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - public String getZone() { - return zone; - } - - public void setZone(String zone) { - this.zone = zone; - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getOssPublicKey() { - return ossPublicKey; - } - - public void setOssPublicKey(String ossPublicKey) { - this.ossPublicKey = ossPublicKey; - } - - public String getOssPrivateKey() { - return ossPrivateKey; - } - - public void setOssPrivateKey(String ossPrivateKey) { - this.ossPrivateKey = ossPrivateKey; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoResult.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoResult.java deleted file mode 100644 index 179205f9..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/ModifyUAIOcrResourceOssInfoResult.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.ucloud.ocr.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - -/** - * @Description :修改UAI-OCR资源对象存储信息 - * @Author : codezhang - * @Date : 2019-04-19 16:16 - **/ -public class ModifyUAIOcrResourceOssInfoResult extends BaseResponseResult { - -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceInfo.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceInfo.java deleted file mode 100644 index 6aca628b..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceInfo.java +++ /dev/null @@ -1,97 +0,0 @@ -package cn.ucloud.ocr.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - -/** - * @Description :UAI-OCR资源信息 - * @Author : codezhang - * @Date : 2019-04-19 15:46 - **/ -public class UAIOcrResourceInfo { - - /** - * 资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - /** - * 资源名称 - */ - @SerializedName("ResourceName") - private String resourceName; - - /** - * 资源类型 - */ - @SerializedName("ResourceType") - private List resourceType; - - /** - * 资源备注 - */ - @SerializedName("ResourceMemo") - private String resourceMemo; - - /** - * 资源状态 - */ - @SerializedName("Status") - private String status; - - /** - * 资源创建时间 - */ - @SerializedName("CreateTime") - private Long createTime; - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public List getResourceType() { - return resourceType; - } - - public void setResourceType(List resourceType) { - this.resourceType = resourceType; - } - - public String getResourceMemo() { - return resourceMemo; - } - - public void setResourceMemo(String resourceMemo) { - this.resourceMemo = resourceMemo; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceRecordInfo.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceRecordInfo.java deleted file mode 100644 index b7fa1632..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceRecordInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.ucloud.ocr.model; - -import com.google.gson.annotations.SerializedName; - -/** - * @Description :UAI-OCR资源请求记录信息 - * @Author : codezhang - * @Date : 2019-04-19 16:23 - **/ -public class UAIOcrResourceRecordInfo { - - /** - * 资源ID - */ - @SerializedName("ResourceId") - private String resourceId; - - /** - * 资源状态 - */ - @SerializedName("Status") - private String status; - - /** - * OCR请求数 - */ - @SerializedName("OcrCount") - private Integer ocrCount; - - /** - * 最新请求记录创建时间 - */ - @SerializedName("LatestRecordTime") - private Long latestRecordTime; - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Integer getOcrCount() { - return ocrCount; - } - - public void setOcrCount(Integer ocrCount) { - this.ocrCount = ocrCount; - } - - public Long getLatestRecordTime() { - return latestRecordTime; - } - - public void setLatestRecordTime(Long latestRecordTime) { - this.latestRecordTime = latestRecordTime; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceTypeInfo.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceTypeInfo.java deleted file mode 100644 index 38e87647..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/model/UAIOcrResourceTypeInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.ucloud.ocr.model; - -import com.google.gson.annotations.SerializedName; - -/** - * @Description : UAI-OCR资源类型信息 - * @Author : codezhang - * @Date : 2019-04-19 15:29 - **/ -public class UAIOcrResourceTypeInfo { - - /** - * UAI-OCR资源类型ID - */ - @SerializedName("ResourceTypeId") - private Integer resourceTypeId; - - /** - * UAI-OCR资源类型名称 - */ - @SerializedName("ResourceTypeName") - private String resourceTypeName; - - public Integer getResourceTypeId() { - return resourceTypeId; - } - - public void setResourceTypeId(Integer resourceTypeId) { - this.resourceTypeId = resourceTypeId; - } - - public String getResourceTypeName() { - return resourceTypeName; - } - - public void setResourceTypeName(String resourceTypeName) { - this.resourceTypeName = resourceTypeName; - } -} diff --git a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/pojo/OcrConfig.java b/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/pojo/OcrConfig.java deleted file mode 100644 index 3d926433..00000000 --- a/ucloud-sdk-java-ocr/src/main/java/cn/ucloud/ocr/pojo/OcrConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.ucloud.ocr.pojo; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.common.pojo.UcloudConfig; - -/** - * @Description : OCR 配置类 - * @Author : codezhang - * @Date : 2019-04-19 15:23 - **/ -public class OcrConfig extends UcloudConfig { - - public OcrConfig(Account account) { - super(account); - } -} diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/CreateUAIOcrResourceTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/CreateUAIOcrResourceTest.java deleted file mode 100644 index 78d00018..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/CreateUAIOcrResourceTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.CreateUAIOcrResourceParam; -import cn.ucloud.ocr.model.CreateUAIOcrResourceResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 15:41 - **/ -public class CreateUAIOcrResourceTest { - - private OcrClient client; - - private CreateUAIOcrResourceParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - List ids = new ArrayList<>(); - ids.add(0); - param = new CreateUAIOcrResourceParam(region,ids); - param.setProjectId(projectId); - } - - @Test - public void createUAIOcrResource() { - try { - CreateUAIOcrResourceResult result = - client.createUAIOcrResource(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/DeleteUAIOcrResourceTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/DeleteUAIOcrResourceTest.java deleted file mode 100644 index f3d363fc..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/DeleteUAIOcrResourceTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceParam; -import cn.ucloud.ocr.model.DeleteUAIOcrResourceResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 16:41 - **/ -public class DeleteUAIOcrResourceTest { - - private OcrClient client; - - private DeleteUAIOcrResourceParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String resourceId = "uaiocr-uw4cd44y"; - param = new DeleteUAIOcrResourceParam(region, resourceId); - param.setProjectId(projectId); - } - - @Test - public void deleteUAIOcrResource() { - try { - DeleteUAIOcrResourceResult result = - client.deleteUAIOcrResource(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrAvailResourceTypeTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrAvailResourceTypeTest.java deleted file mode 100644 index 1e07a401..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrAvailResourceTypeTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeParam; -import cn.ucloud.ocr.model.GetUAIOcrAvailResourceTypeResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 15:33 - **/ -public class GetUAIOcrAvailResourceTypeTest { - - - private OcrClient client; - - private GetUAIOcrAvailResourceTypeParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - param = new GetUAIOcrAvailResourceTypeParam(region); - param.setProjectId(projectId); - } - - @Test - public void getUAICensorAvailResourceType() { - try { - GetUAIOcrAvailResourceTypeResult result = - client.getUAIOcrAvailResourceType(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } - -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceListTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceListTest.java deleted file mode 100644 index 4098e820..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceListTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.GetUAIOcrResourceListParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceListResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 15:51 - **/ -public class GetUAIOcrResourceListTest { - - private OcrClient client; - - private GetUAIOcrResourceListParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - param = new GetUAIOcrResourceListParam(region); - param.setProjectId(projectId); - } - - @Test - public void getUAIOcrResourceList() { - try { - GetUAIOcrResourceListResult result = - client.getUAIOcrResourceList(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceRecordInfoTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceRecordInfoTest.java deleted file mode 100644 index 286be991..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/GetUAIOcrResourceRecordInfoTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoParam; -import cn.ucloud.ocr.model.GetUAIOcrResourceRecordInfoResult; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 16:36 - **/ -public class GetUAIOcrResourceRecordInfoTest { - private OcrClient client; - - private GetUAIOcrResourceRecordInfoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - Long beginTime = 1555557017L; - Long endTime = 1555638570L; - param = new GetUAIOcrResourceRecordInfoParam(region,beginTime,endTime); - param.setProjectId(projectId); - } - - @Test - public void getUAIOcrResourceRecordInfo() { - try { - GetUAIOcrResourceRecordInfoResult result = - client.getUAIOcrResourceRecordInfo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/JSONComparator.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/JSONComparator.java deleted file mode 100644 index c0456640..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/JSONComparator.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-03-05 21:32 - **/ -public class JSONComparator { - - private static final Logger logger = LoggerFactory.getLogger(JSONComparator.class.getName()); - - public static void jsonComparator(BaseResponseResult result) { - try { - Gson gson = new GsonBuilder().serializeNulls().create(); - logger.info("result 2 json:{}", gson.toJson(result)); - JSONAssert.assertEquals(result.getResponseContent(), gson.toJson(result), JSONCompareMode.LENIENT); - } catch (Exception e) { - assertNull(e); - } - } - -} diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceMemoTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceMemoTest.java deleted file mode 100644 index 49f0d48f..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceMemoTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceMemoResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 16:04 - **/ -public class ModifyUAIOcrResourceMemoTest { - - private OcrClient client; - - private ModifyUAIOcrResourceMemoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String resourceId = "uaiocr-uw4cd44y"; - String resourceMemo = "sdk-test"; - param = new ModifyUAIOcrResourceMemoParam(region,resourceId,resourceMemo); - param.setProjectId(projectId); - } - - @Test - public void modifyUAIOcrResourceMemo() { - try { - ModifyUAIOcrResourceMemoResult result = - client.modifyUAIOcrResourceMemo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceNameTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceNameTest.java deleted file mode 100644 index 580c2fcb..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceNameTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceNameResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 16:04 - **/ -public class ModifyUAIOcrResourceNameTest { - - private OcrClient client; - - private ModifyUAIOcrResourceNameParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String resourceId = "uaiocr-uw4cd44y"; - String resourceName = "sdk-test-name"; - param = new ModifyUAIOcrResourceNameParam(region,resourceId,resourceName); - param.setProjectId(projectId); - } - - @Test - public void modifyUAIOcrResourceName() { - try { - ModifyUAIOcrResourceNameResult result = - client.modifyUAIOcrResourceName(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceOssInfoTest.java b/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceOssInfoTest.java deleted file mode 100644 index 7202e57c..00000000 --- a/ucloud-sdk-java-ocr/src/test/java/cn/ucloud/ocr/client/ModifyUAIOcrResourceOssInfoTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.ucloud.ocr.client; - -import cn.ucloud.common.pojo.Account; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoParam; -import cn.ucloud.ocr.model.ModifyUAIOcrResourceOssInfoResult; -import cn.ucloud.ocr.pojo.OcrConfig; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertNull; - -/** - * @Description : - * @Author : codezhang - * @Date : 2019-04-19 16:04 - **/ -public class ModifyUAIOcrResourceOssInfoTest { - - private OcrClient client; - - private ModifyUAIOcrResourceOssInfoParam param; - - @Before - public void setUp() throws Exception { - client = new DefaultOcrClient(new OcrConfig( - new Account(System.getenv("UCloudPrivateKey"), - System.getenv("UCloudPublicKey")))); - String projectId = System.getenv("ProjectId"); - String region = "cn-bj2"; - String resourceId = "uaiocr-uw4cd44y"; - String privateKey = "xxxxx"; - String publicKey = "xxxxx"; - param = new ModifyUAIOcrResourceOssInfoParam(region, resourceId, privateKey,publicKey); - param.setProjectId(projectId); - } - - @Test - public void modifyUAIOcrResourceOssInfo() { - try { - ModifyUAIOcrResourceOssInfoResult result = - client.modifyUAIOcrResourceOssInfo(param); - JSONComparator.jsonComparator(result); - } catch (Exception e) { - assertNull(e); - } - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/pom.xml b/ucloud-sdk-java-pathx/pom.xml index e98a33a2..f077dd71 100644 --- a/ucloud-sdk-java-pathx/pom.xml +++ b/ucloud-sdk-java-pathx/pom.xml @@ -1,27 +1,23 @@ - ucloud-sdk-java cn.ucloud - 0.8.4.4-release + 1.2.51-release 4.0.0 - 0.8.4.4-release ucloud-sdk-java-pathx + ucloud-sdk-java + 1.2.51-release cn.ucloud ucloud-sdk-java-common - 0.8.4.4-release - - - - org.hibernate - hibernate-validator + 1.2.51-release @@ -29,29 +25,25 @@ gson - - junit - junit - test + commons-codec + commons-codec - org.apache.commons commons-lang3 - org.slf4j - slf4j-simple - provided + junit + junit + test - org.skyscreamer - jsonassert - test + org.slf4j + slf4j-simple + provided - - \ No newline at end of file + diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/DefaultPATHXClient.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/DefaultPATHXClient.java deleted file mode 100644 index d3fecd76..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/DefaultPATHXClient.java +++ /dev/null @@ -1,598 +0,0 @@ -package cn.ucloud.pathx.client; - -import cn.ucloud.common.client.DefaultUcloudClient; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.common.http.UcloudHttp; -import cn.ucloud.common.http.UcloudHttpImpl; -import cn.ucloud.pathx.model.*; -import cn.ucloud.pathx.pojo.PATHXConfig; - -/** - * @Description : PATHX 默认客户端接口实现 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DefaultPATHXClient extends DefaultUcloudClient implements PATHXClient { - public DefaultPATHXClient(PATHXConfig config) { - super(config); - } - - @Override - public DeleteUPathResult deleteUPath(DeleteUPathParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteUPathResult.class); - return (DeleteUPathResult) http.doPost(param, config, null); - } - - @Override - public void deleteUPath(DeleteUPathParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteUPathResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateGlobalSSHInstanceResult createGlobalSSHInstance(CreateGlobalSSHInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateGlobalSSHInstanceResult.class); - return (CreateGlobalSSHInstanceResult) http.doPost(param, config, null); - } - - @Override - public void createGlobalSSHInstance(CreateGlobalSSHInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(CreateGlobalSSHInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUGAUpdatePriceResult getUGAUpdatePrice(GetUGAUpdatePriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUGAUpdatePriceResult.class); - return (GetUGAUpdatePriceResult) http.doPost(param, config, null); - } - - @Override - public void getUGAUpdatePrice(GetUGAUpdatePriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUGAUpdatePriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUPathNameResult modifyUPathName(ModifyUPathNameParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathNameResult.class); - return (ModifyUPathNameResult) http.doPost(param, config, null); - } - - @Override - public void modifyUPathName(ModifyUPathNameParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathNameResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUPathBandwidthResult modifyUPathBandwidth(ModifyUPathBandwidthParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathBandwidthResult.class); - return (ModifyUPathBandwidthResult) http.doPost(param, config, null); - } - - @Override - public void modifyUPathBandwidth(ModifyUPathBandwidthParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathBandwidthResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeUPathResult describeUPath(DescribeUPathParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeUPathResult.class); - return (DescribeUPathResult) http.doPost(param, config, null); - } - - @Override - public void describeUPath(DescribeUPathParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeUPathResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public UGAUnBindUPathResult uGAUnBindUPath(UGAUnBindUPathParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(UGAUnBindUPathResult.class); - return (UGAUnBindUPathResult) http.doPost(param, config, null); - } - - @Override - public void uGAUnBindUPath(UGAUnBindUPathParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(UGAUnBindUPathResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public UGABindUPathResult uGABindUPath(UGABindUPathParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(UGABindUPathResult.class); - return (UGABindUPathResult) http.doPost(param, config, null); - } - - @Override - public void uGABindUPath(UGABindUPathParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(UGABindUPathResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeUPathTemplateResult describeUPathTemplate(DescribeUPathTemplateParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeUPathTemplateResult.class); - return (DescribeUPathTemplateResult) http.doPost(param, config, null); - } - - @Override - public void describeUPathTemplate(DescribeUPathTemplateParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeUPathTemplateResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyUPathTemplateResult modifyUPathTemplate(ModifyUPathTemplateParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathTemplateResult.class); - return (ModifyUPathTemplateResult) http.doPost(param, config, null); - } - - @Override - public void modifyUPathTemplate(ModifyUPathTemplateParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyUPathTemplateResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUPathUpdatePriceResult getUPathUpdatePrice(GetUPathUpdatePriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUPathUpdatePriceResult.class); - return (GetUPathUpdatePriceResult) http.doPost(param, config, null); - } - - @Override - public void getUPathUpdatePrice(GetUPathUpdatePriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUPathUpdatePriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetCommonUGAPriceResult getCommonUGAPrice(GetCommonUGAPriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetCommonUGAPriceResult.class); - return (GetCommonUGAPriceResult) http.doPost(param, config, null); - } - - @Override - public void getCommonUGAPrice(GetCommonUGAPriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetCommonUGAPriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DeleteCommonUGAInstanceResult deleteCommonUGAInstance(DeleteCommonUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteCommonUGAInstanceResult.class); - return (DeleteCommonUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void deleteCommonUGAInstance(DeleteCommonUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteCommonUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DeleteUGATaskResult deleteUGATask(DeleteUGATaskParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteUGATaskResult.class); - return (DeleteUGATaskResult) http.doPost(param, config, null); - } - - @Override - public void deleteUGATask(DeleteUGATaskParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteUGATaskResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public AddUGATaskResult addUGATask(AddUGATaskParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(AddUGATaskResult.class); - return (AddUGATaskResult) http.doPost(param, config, null); - } - - @Override - public void addUGATask(AddUGATaskParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(AddUGATaskResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateUGAInstanceResult createUGAInstance(CreateUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateUGAInstanceResult.class); - return (CreateUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void createUGAInstance(CreateUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(CreateUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DeleteUGAInstanceResult deleteUGAInstance(DeleteUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteUGAInstanceResult.class); - return (DeleteUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void deleteUGAInstance(DeleteUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeUGAInstanceResult describeUGAInstance(DescribeUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeUGAInstanceResult.class); - return (DescribeUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void describeUGAInstance(DescribeUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeCommonUGAInstanceResult describeCommonUGAInstance(DescribeCommonUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeCommonUGAInstanceResult.class); - return (DescribeCommonUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void describeCommonUGAInstance(DescribeCommonUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeCommonUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetPathXMetricResult getPathXMetric(GetPathXMetricParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetPathXMetricResult.class); - return (GetPathXMetricResult) http.doPost(param, config, null); - } - - @Override - public void getPathXMetric(GetPathXMetricParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetPathXMetricResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribePathXLineConfigResult describePathXLineConfig(DescribePathXLineConfigParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribePathXLineConfigResult.class); - return (DescribePathXLineConfigResult) http.doPost(param, config, null); - } - - @Override - public void describePathXLineConfig(DescribePathXLineConfigParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribePathXLineConfigResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DeleteGlobalSSHInstanceResult deleteGlobalSSHInstance(DeleteGlobalSSHInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DeleteGlobalSSHInstanceResult.class); - return (DeleteGlobalSSHInstanceResult) http.doPost(param, config, null); - } - - @Override - public void deleteGlobalSSHInstance(DeleteGlobalSSHInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DeleteGlobalSSHInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public InsertPathXWhitelistResult insertPathXWhitelist(InsertPathXWhitelistParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(InsertPathXWhitelistResult.class); - return (InsertPathXWhitelistResult) http.doPost(param, config, null); - } - - @Override - public void insertPathXWhitelist(InsertPathXWhitelistParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(InsertPathXWhitelistResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetUGAPriceResult getUGAPrice(GetUGAPriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUGAPriceResult.class); - return (GetUGAPriceResult) http.doPost(param, config, null); - } - - @Override - public void getUGAPrice(GetUGAPriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUGAPriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - - @Override - public GetUPathPriceResult getUPathPrice(GetUPathPriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetUPathPriceResult.class); - return (GetUPathPriceResult) http.doPost(param, config, null); - } - - @Override - public void getUPathPrice(GetUPathPriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetUPathPriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyGlobalSSHPortResult modifyGlobalSSHPort(ModifyGlobalSSHPortParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyGlobalSSHPortResult.class); - return (ModifyGlobalSSHPortResult) http.doPost(param, config, null); - } - - @Override - public void modifyGlobalSSHPort(ModifyGlobalSSHPortParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyGlobalSSHPortResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public UpdatePathXWhitelistResult updatePathXWhitelist(UpdatePathXWhitelistParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(UpdatePathXWhitelistResult.class); - return (UpdatePathXWhitelistResult) http.doPost(param, config, null); - } - - @Override - public void updatePathXWhitelist(UpdatePathXWhitelistParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(UpdatePathXWhitelistResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribePathXWhitelistResult describePathXWhitelist(DescribePathXWhitelistParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribePathXWhitelistResult.class); - return (DescribePathXWhitelistResult) http.doPost(param, config, null); - } - - @Override - public void describePathXWhitelist(DescribePathXWhitelistParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribePathXWhitelistResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public ModifyGlobalSSHRemarkResult modifyGlobalSSHRemark(ModifyGlobalSSHRemarkParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(ModifyGlobalSSHRemarkResult.class); - return (ModifyGlobalSSHRemarkResult) http.doPost(param, config, null); - } - - @Override - public void modifyGlobalSSHRemark(ModifyGlobalSSHRemarkParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(ModifyGlobalSSHRemarkResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetGlobalSSHMetricResult getGlobalSSHMetric(GetGlobalSSHMetricParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHMetricResult.class); - return (GetGlobalSSHMetricResult) http.doPost(param, config, null); - } - - @Override - public void getGlobalSSHMetric(GetGlobalSSHMetricParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHMetricResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeGlobalSSHAreaResult describeGlobalSSHArea(DescribeGlobalSSHAreaParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeGlobalSSHAreaResult.class); - return (DescribeGlobalSSHAreaResult) http.doPost(param, config, null); - } - - @Override - public void describeGlobalSSHArea(DescribeGlobalSSHAreaParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeGlobalSSHAreaResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetGlobalSSHPriceResult getGlobalSSHPrice(GetGlobalSSHPriceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHPriceResult.class); - return (GetGlobalSSHPriceResult) http.doPost(param, config, null); - } - - @Override - public void getGlobalSSHPrice(GetGlobalSSHPriceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHPriceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public GetGlobalSSHTrafficResult getGlobalSSHTraffic(GetGlobalSSHTrafficParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHTrafficResult.class); - return (GetGlobalSSHTrafficResult) http.doPost(param, config, null); - } - - @Override - public void getGlobalSSHTraffic(GetGlobalSSHTrafficParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(GetGlobalSSHTrafficResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateUPathResult createUPath(CreateUPathParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateUPathResult.class); - return (CreateUPathResult) http.doPost(param, config, null); - } - - @Override - public void createUPath(CreateUPathParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(CreateUPathResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public CreateCommonUGAInstanceResult createCommonUGAInstance(CreateCommonUGAInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(CreateCommonUGAInstanceResult.class); - return (CreateCommonUGAInstanceResult) http.doPost(param, config, null); - } - - @Override - public void createCommonUGAInstance(CreateCommonUGAInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(CreateCommonUGAInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - @Override - public DescribeGlobalSSHInstanceResult describeGlobalSSHInstance(DescribeGlobalSSHInstanceParam param) throws Exception { - UcloudHttp http = new UcloudHttpImpl(DescribeGlobalSSHInstanceResult.class); - return (DescribeGlobalSSHInstanceResult) http.doPost(param, config, null); - } - - @Override - public void describeGlobalSSHInstance(DescribeGlobalSSHInstanceParam param, - UcloudHandler handler, Boolean... asyncFlag) { - UcloudHttp http = new UcloudHttpImpl(DescribeGlobalSSHInstanceResult.class); - try { - http.doPost(param, config, handler, asyncFlag); - } catch (Exception e) { - } - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PATHXClient.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PATHXClient.java deleted file mode 100644 index 34dab554..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PATHXClient.java +++ /dev/null @@ -1,770 +0,0 @@ -package cn.ucloud.pathx.client; - -import cn.ucloud.common.client.UcloudClient; -import cn.ucloud.common.handler.UcloudHandler; -import cn.ucloud.pathx.model.*; - -/** - * @Description : PATHX 客户端接口 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public interface PATHXClient extends UcloudClient { - - /** - * 删除UPath - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteUPathResult deleteUPath( - DeleteUPathParam param) throws Exception; - - /** - * 删除UPath (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteUPath(DeleteUPathParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 创建GlobalSSH实例 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateGlobalSSHInstanceResult createGlobalSSHInstance( - CreateGlobalSSHInstanceParam param) throws Exception; - - /** - * 创建GlobalSSH实例 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createGlobalSSHInstance(CreateGlobalSSHInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取UGA更新价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUGAUpdatePriceResult getUGAUpdatePrice( - GetUGAUpdatePriceParam param) throws Exception; - - /** - * 获取UGA更新价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUGAUpdatePrice(GetUGAUpdatePriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 更改加速线路名字 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUPathNameResult modifyUPathName( - ModifyUPathNameParam param) throws Exception; - - /** - * 更改加速线路名字 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUPathName(ModifyUPathNameParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 修改加速线路带宽 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUPathBandwidthResult modifyUPathBandwidth( - ModifyUPathBandwidthParam param) throws Exception; - - /** - * 修改加速线路带宽 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUPathBandwidth(ModifyUPathBandwidthParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取加速线路信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeUPathResult describeUPath( - DescribeUPathParam param) throws Exception; - - /** - * 获取加速线路信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeUPath(DescribeUPathParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * UGA与UPath解绑 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - UGAUnBindUPathResult uGAUnBindUPath( - UGAUnBindUPathParam param) throws Exception; - - /** - * UGA与UPath解绑 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void uGAUnBindUPath(UGAUnBindUPathParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * UGA绑定UPath - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - UGABindUPathResult uGABindUPath( - UGABindUPathParam param) throws Exception; - - /** - * UGA绑定UPath (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void uGABindUPath(UGABindUPathParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 查询UPath的监控模板 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeUPathTemplateResult describeUPathTemplate( - DescribeUPathTemplateParam param) throws Exception; - - /** - * 查询UPath的监控模板 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeUPathTemplate(DescribeUPathTemplateParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 修改UPath监控告警项 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyUPathTemplateResult modifyUPathTemplate( - ModifyUPathTemplateParam param) throws Exception; - - /** - * 修改UPath监控告警项 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyUPathTemplate(ModifyUPathTemplateParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取UPath升级价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUPathUpdatePriceResult getUPathUpdatePrice( - GetUPathUpdatePriceParam param) throws Exception; - - /** - * 获取UPath升级价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUPathUpdatePrice(GetUPathUpdatePriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取苹果加速通道价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetCommonUGAPriceResult getCommonUGAPrice( - GetCommonUGAPriceParam param) throws Exception; - - /** - * 获取苹果加速通道价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getCommonUGAPrice(GetCommonUGAPriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 删除苹果加速通道 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteCommonUGAInstanceResult deleteCommonUGAInstance( - DeleteCommonUGAInstanceParam param) throws Exception; - - /** - * 删除苹果加速通道 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteCommonUGAInstance(DeleteCommonUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 删除加速配置端口 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteUGATaskResult deleteUGATask( - DeleteUGATaskParam param) throws Exception; - - /** - * 删除加速配置端口 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteUGATask(DeleteUGATaskParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 添加加速配置端口 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - AddUGATaskResult addUGATask( - AddUGATaskParam param) throws Exception; - - /** - * 添加加速配置端口 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void addUGATask(AddUGATaskParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 创建全球加速配置项 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateUGAInstanceResult createUGAInstance( - CreateUGAInstanceParam param) throws Exception; - - /** - * 创建全球加速配置项 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createUGAInstance(CreateUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 删除全球加速服务加速配置 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteUGAInstanceResult deleteUGAInstance( - DeleteUGAInstanceParam param) throws Exception; - - /** - * 删除全球加速服务加速配置 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteUGAInstance(DeleteUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取全球加速服务加速配置信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeUGAInstanceResult describeUGAInstance( - DescribeUGAInstanceParam param) throws Exception; - - /** - * 获取全球加速服务加速配置信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeUGAInstance(DescribeUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取苹果加速通道信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeCommonUGAInstanceResult describeCommonUGAInstance( - DescribeCommonUGAInstanceParam param) throws Exception; - - /** - * 获取苹果加速通道信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeCommonUGAInstance(DescribeCommonUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取全球加速监控信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetPathXMetricResult getPathXMetric( - GetPathXMetricParam param) throws Exception; - - /** - * 获取全球加速监控信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getPathXMetric(GetPathXMetricParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取全球加速线路信息 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribePathXLineConfigResult describePathXLineConfig( - DescribePathXLineConfigParam param) throws Exception; - - /** - * 获取全球加速线路信息 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describePathXLineConfig(DescribePathXLineConfigParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 删除GlobalSSH实例 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DeleteGlobalSSHInstanceResult deleteGlobalSSHInstance( - DeleteGlobalSSHInstanceParam param) throws Exception; - - /** - * 删除GlobalSSH实例 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void deleteGlobalSSHInstance(DeleteGlobalSSHInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 增量插入白名单 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - InsertPathXWhitelistResult insertPathXWhitelist( - InsertPathXWhitelistParam param) throws Exception; - - /** - * 增量插入白名单 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void insertPathXWhitelist(InsertPathXWhitelistParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取UGA价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUGAPriceResult getUGAPrice( - GetUGAPriceParam param) throws Exception; - - /** - * 获取UGA价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUGAPrice(GetUGAPriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取UPath价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetUPathPriceResult getUPathPrice( - GetUPathPriceParam param) throws Exception; - - /** - * 获取UPath价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getUPathPrice(GetUPathPriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 修改GlobalSSH端口 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyGlobalSSHPortResult modifyGlobalSSHPort( - ModifyGlobalSSHPortParam param) throws Exception; - - /** - * 修改GlobalSSH端口 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyGlobalSSHPort(ModifyGlobalSSHPortParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 添加或更新入口白名单 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - UpdatePathXWhitelistResult updatePathXWhitelist( - UpdatePathXWhitelistParam param) throws Exception; - - /** - * 添加或更新入口白名单 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void updatePathXWhitelist(UpdatePathXWhitelistParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取入口白名单列表 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribePathXWhitelistResult describePathXWhitelist( - DescribePathXWhitelistParam param) throws Exception; - - /** - * 获取入口白名单列表 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describePathXWhitelist(DescribePathXWhitelistParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 修改GlobalSSH备注 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - ModifyGlobalSSHRemarkResult modifyGlobalSSHRemark( - ModifyGlobalSSHRemarkParam param) throws Exception; - - /** - * 修改GlobalSSH备注 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void modifyGlobalSSHRemark(ModifyGlobalSSHRemarkParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取GlobalSSH出入带宽数据 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetGlobalSSHMetricResult getGlobalSSHMetric( - GetGlobalSSHMetricParam param) throws Exception; - - /** - * 获取GlobalSSH出入带宽数据 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getGlobalSSHMetric(GetGlobalSSHMetricParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取GlobalSSH覆盖的地区列表 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeGlobalSSHAreaResult describeGlobalSSHArea( - DescribeGlobalSSHAreaParam param) throws Exception; - - /** - * 获取GlobalSSH覆盖的地区列表 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeGlobalSSHArea(DescribeGlobalSSHAreaParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取GlobalSSH价格 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetGlobalSSHPriceResult getGlobalSSHPrice( - GetGlobalSSHPriceParam param) throws Exception; - - /** - * 获取GlobalSSH价格 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getGlobalSSHPrice(GetGlobalSSHPriceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取全球运维通道流量统计数据 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - GetGlobalSSHTrafficResult getGlobalSSHTraffic( - GetGlobalSSHTrafficParam param) throws Exception; - - /** - * 获取全球运维通道流量统计数据 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void getGlobalSSHTraffic(GetGlobalSSHTrafficParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 创建UPath - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateUPathResult createUPath( - CreateUPathParam param) throws Exception; - - /** - * 创建UPath (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createUPath(CreateUPathParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 创建苹果审核加速通道 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - CreateCommonUGAInstanceResult createCommonUGAInstance( - CreateCommonUGAInstanceParam param) throws Exception; - - /** - * 创建苹果审核加速通道 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void createCommonUGAInstance(CreateCommonUGAInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - - /** - * 获取GlobalSSH实例列表 - * - * @param param 参数对象 - * @return 结果对象 - * @throws Exception - */ - DescribeGlobalSSHInstanceResult describeGlobalSSHInstance( - DescribeGlobalSSHInstanceParam param) throws Exception; - - /** - * 获取GlobalSSH实例列表 (回调) - * - * @param param 参数对象 - * @param handler 回调接口 - * @param asyncFlag 是否异步 - */ - void describeGlobalSSHInstance(DescribeGlobalSSHInstanceParam param, - UcloudHandler handler, - Boolean... asyncFlag); - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClient.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClient.java new file mode 100644 index 00000000..4fa2a130 --- /dev/null +++ b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClient.java @@ -0,0 +1,471 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.pathx.client; + +import cn.ucloud.common.client.DefaultClient; +import cn.ucloud.common.config.Config; +import cn.ucloud.common.credential.Credential; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.pathx.models.BindPathXSSLRequest; +import cn.ucloud.pathx.models.BindPathXSSLResponse; +import cn.ucloud.pathx.models.CreateGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.CreateGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.CreatePathXSSLRequest; +import cn.ucloud.pathx.models.CreatePathXSSLResponse; +import cn.ucloud.pathx.models.CreateUGAForwarderRequest; +import cn.ucloud.pathx.models.CreateUGAForwarderResponse; +import cn.ucloud.pathx.models.CreateUGAInstanceRequest; +import cn.ucloud.pathx.models.CreateUGAInstanceResponse; +import cn.ucloud.pathx.models.CreateUPathRequest; +import cn.ucloud.pathx.models.CreateUPathResponse; +import cn.ucloud.pathx.models.DeleteGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.DeleteGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.DeletePathXSSLRequest; +import cn.ucloud.pathx.models.DeletePathXSSLResponse; +import cn.ucloud.pathx.models.DeleteUGAForwarderRequest; +import cn.ucloud.pathx.models.DeleteUGAForwarderResponse; +import cn.ucloud.pathx.models.DeleteUGAInstanceRequest; +import cn.ucloud.pathx.models.DeleteUGAInstanceResponse; +import cn.ucloud.pathx.models.DeleteUPathRequest; +import cn.ucloud.pathx.models.DeleteUPathResponse; +import cn.ucloud.pathx.models.DescribeGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.DescribeGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.DescribePathXLineConfigRequest; +import cn.ucloud.pathx.models.DescribePathXLineConfigResponse; +import cn.ucloud.pathx.models.DescribePathXSSLRequest; +import cn.ucloud.pathx.models.DescribePathXSSLResponse; +import cn.ucloud.pathx.models.DescribeUGAInstanceRequest; +import cn.ucloud.pathx.models.DescribeUGAInstanceResponse; +import cn.ucloud.pathx.models.DescribeUPathRequest; +import cn.ucloud.pathx.models.DescribeUPathResponse; +import cn.ucloud.pathx.models.DescribeUPathTemplateRequest; +import cn.ucloud.pathx.models.DescribeUPathTemplateResponse; +import cn.ucloud.pathx.models.GetGlobalSSHPriceRequest; +import cn.ucloud.pathx.models.GetGlobalSSHPriceResponse; +import cn.ucloud.pathx.models.GetGlobalSSHTrafficRequest; +import cn.ucloud.pathx.models.GetGlobalSSHTrafficResponse; +import cn.ucloud.pathx.models.GetGlobalSSHUpdatePriceRequest; +import cn.ucloud.pathx.models.GetGlobalSSHUpdatePriceResponse; +import cn.ucloud.pathx.models.GetPathXMetricRequest; +import cn.ucloud.pathx.models.GetPathXMetricResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHOriginInfoRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHOriginInfoResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHPortRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHPortResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHRemarkRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHRemarkResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHTypeRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHTypeResponse; +import cn.ucloud.pathx.models.ModifyUPathBandwidthRequest; +import cn.ucloud.pathx.models.ModifyUPathBandwidthResponse; +import cn.ucloud.pathx.models.ModifyUPathTemplateRequest; +import cn.ucloud.pathx.models.ModifyUPathTemplateResponse; +import cn.ucloud.pathx.models.UGABindUPathRequest; +import cn.ucloud.pathx.models.UGABindUPathResponse; +import cn.ucloud.pathx.models.UGAUnBindUPathRequest; +import cn.ucloud.pathx.models.UGAUnBindUPathResponse; +import cn.ucloud.pathx.models.UnBindPathXSSLRequest; +import cn.ucloud.pathx.models.UnBindPathXSSLResponse; +import cn.ucloud.pathx.models.UpdatePathXWhitelistRequest; +import cn.ucloud.pathx.models.UpdatePathXWhitelistResponse; + +/** This client is used to call actions of **PathX** service */ +public class PathXClient extends DefaultClient implements PathXClientInterface { + public PathXClient(Config config, Credential credential) { + super(config, credential); + } + + /** + * BindPathXSSL - 绑定PathX SSL证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindPathXSSLResponse bindPathXSSL(BindPathXSSLRequest request) throws UCloudException { + request.setAction("BindPathXSSL"); + return (BindPathXSSLResponse) this.invoke(request, BindPathXSSLResponse.class); + } + + /** + * CreateGlobalSSHInstance - 创建GlobalSSH实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateGlobalSSHInstanceResponse createGlobalSSHInstance( + CreateGlobalSSHInstanceRequest request) throws UCloudException { + request.setAction("CreateGlobalSSHInstance"); + return (CreateGlobalSSHInstanceResponse) + this.invoke(request, CreateGlobalSSHInstanceResponse.class); + } + + /** + * CreatePathXSSL - 创建证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreatePathXSSLResponse createPathXSSL(CreatePathXSSLRequest request) + throws UCloudException { + request.setAction("CreatePathXSSL"); + return (CreatePathXSSLResponse) this.invoke(request, CreatePathXSSLResponse.class); + } + + /** + * CreateUGAForwarder - 创建加速实例转发器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUGAForwarderResponse createUGAForwarder(CreateUGAForwarderRequest request) + throws UCloudException { + request.setAction("CreateUGAForwarder"); + return (CreateUGAForwarderResponse) this.invoke(request, CreateUGAForwarderResponse.class); + } + + /** + * CreateUGAInstance - 创建全球加速配置项 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUGAInstanceResponse createUGAInstance(CreateUGAInstanceRequest request) + throws UCloudException { + request.setAction("CreateUGAInstance"); + return (CreateUGAInstanceResponse) this.invoke(request, CreateUGAInstanceResponse.class); + } + + /** + * CreateUPath - 创建UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUPathResponse createUPath(CreateUPathRequest request) throws UCloudException { + request.setAction("CreateUPath"); + return (CreateUPathResponse) this.invoke(request, CreateUPathResponse.class); + } + + /** + * DeleteGlobalSSHInstance - 删除GlobalSSH实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteGlobalSSHInstanceResponse deleteGlobalSSHInstance( + DeleteGlobalSSHInstanceRequest request) throws UCloudException { + request.setAction("DeleteGlobalSSHInstance"); + return (DeleteGlobalSSHInstanceResponse) + this.invoke(request, DeleteGlobalSSHInstanceResponse.class); + } + + /** + * DeletePathXSSL - 删除PathX SSL证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeletePathXSSLResponse deletePathXSSL(DeletePathXSSLRequest request) + throws UCloudException { + request.setAction("DeletePathXSSL"); + return (DeletePathXSSLResponse) this.invoke(request, DeletePathXSSLResponse.class); + } + + /** + * DeleteUGAForwarder - 删除加速实例转发器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUGAForwarderResponse deleteUGAForwarder(DeleteUGAForwarderRequest request) + throws UCloudException { + request.setAction("DeleteUGAForwarder"); + return (DeleteUGAForwarderResponse) this.invoke(request, DeleteUGAForwarderResponse.class); + } + + /** + * DeleteUGAInstance - 删除全球加速服务加速配置 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUGAInstanceResponse deleteUGAInstance(DeleteUGAInstanceRequest request) + throws UCloudException { + request.setAction("DeleteUGAInstance"); + return (DeleteUGAInstanceResponse) this.invoke(request, DeleteUGAInstanceResponse.class); + } + + /** + * DeleteUPath - 删除UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUPathResponse deleteUPath(DeleteUPathRequest request) throws UCloudException { + request.setAction("DeleteUPath"); + return (DeleteUPathResponse) this.invoke(request, DeleteUPathResponse.class); + } + + /** + * DescribeGlobalSSHInstance - 获取GlobalSSH实例列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeGlobalSSHInstanceResponse describeGlobalSSHInstance( + DescribeGlobalSSHInstanceRequest request) throws UCloudException { + request.setAction("DescribeGlobalSSHInstance"); + return (DescribeGlobalSSHInstanceResponse) + this.invoke(request, DescribeGlobalSSHInstanceResponse.class); + } + + /** + * DescribePathXLineConfig - 获取全球加速线路信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribePathXLineConfigResponse describePathXLineConfig( + DescribePathXLineConfigRequest request) throws UCloudException { + request.setAction("DescribePathXLineConfig"); + return (DescribePathXLineConfigResponse) + this.invoke(request, DescribePathXLineConfigResponse.class); + } + + /** + * DescribePathXSSL - 获取SSL证书信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribePathXSSLResponse describePathXSSL(DescribePathXSSLRequest request) + throws UCloudException { + request.setAction("DescribePathXSSL"); + return (DescribePathXSSLResponse) this.invoke(request, DescribePathXSSLResponse.class); + } + + /** + * DescribeUGAInstance - 获取全球加速服务加速配置信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUGAInstanceResponse describeUGAInstance(DescribeUGAInstanceRequest request) + throws UCloudException { + request.setAction("DescribeUGAInstance"); + return (DescribeUGAInstanceResponse) + this.invoke(request, DescribeUGAInstanceResponse.class); + } + + /** + * DescribeUPath - 获取加速线路信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUPathResponse describeUPath(DescribeUPathRequest request) + throws UCloudException { + request.setAction("DescribeUPath"); + return (DescribeUPathResponse) this.invoke(request, DescribeUPathResponse.class); + } + + /** + * DescribeUPathTemplate - 查询UPath的监控模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUPathTemplateResponse describeUPathTemplate(DescribeUPathTemplateRequest request) + throws UCloudException { + request.setAction("DescribeUPathTemplate"); + return (DescribeUPathTemplateResponse) + this.invoke(request, DescribeUPathTemplateResponse.class); + } + + /** + * GetGlobalSSHPrice - 获取GlobalSSH价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHPriceResponse getGlobalSSHPrice(GetGlobalSSHPriceRequest request) + throws UCloudException { + request.setAction("GetGlobalSSHPrice"); + return (GetGlobalSSHPriceResponse) this.invoke(request, GetGlobalSSHPriceResponse.class); + } + + /** + * GetGlobalSSHTraffic - 获取GlobalSSH流量统计数据 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHTrafficResponse getGlobalSSHTraffic(GetGlobalSSHTrafficRequest request) + throws UCloudException { + request.setAction("GetGlobalSSHTraffic"); + return (GetGlobalSSHTrafficResponse) + this.invoke(request, GetGlobalSSHTrafficResponse.class); + } + + /** + * GetGlobalSSHUpdatePrice - 获取GlobalSSH升级价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHUpdatePriceResponse getGlobalSSHUpdatePrice( + GetGlobalSSHUpdatePriceRequest request) throws UCloudException { + request.setAction("GetGlobalSSHUpdatePrice"); + return (GetGlobalSSHUpdatePriceResponse) + this.invoke(request, GetGlobalSSHUpdatePriceResponse.class); + } + + /** + * GetPathXMetric - 获取全球加速监控信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetPathXMetricResponse getPathXMetric(GetPathXMetricRequest request) + throws UCloudException { + request.setAction("GetPathXMetric"); + return (GetPathXMetricResponse) this.invoke(request, GetPathXMetricResponse.class); + } + + /** + * ModifyGlobalSSHOriginInfo - 修改GlobalSSH 源站信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHOriginInfoResponse modifyGlobalSSHOriginInfo( + ModifyGlobalSSHOriginInfoRequest request) throws UCloudException { + request.setAction("ModifyGlobalSSHOriginInfo"); + return (ModifyGlobalSSHOriginInfoResponse) + this.invoke(request, ModifyGlobalSSHOriginInfoResponse.class); + } + + /** + * ModifyGlobalSSHPort - 修改GlobalSSH端口 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHPortResponse modifyGlobalSSHPort(ModifyGlobalSSHPortRequest request) + throws UCloudException { + request.setAction("ModifyGlobalSSHPort"); + return (ModifyGlobalSSHPortResponse) + this.invoke(request, ModifyGlobalSSHPortResponse.class); + } + + /** + * ModifyGlobalSSHRemark - 修改GlobalSSH备注 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHRemarkResponse modifyGlobalSSHRemark(ModifyGlobalSSHRemarkRequest request) + throws UCloudException { + request.setAction("ModifyGlobalSSHRemark"); + return (ModifyGlobalSSHRemarkResponse) + this.invoke(request, ModifyGlobalSSHRemarkResponse.class); + } + + /** + * ModifyGlobalSSHType - 修改GlobalSSH实例类型 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHTypeResponse modifyGlobalSSHType(ModifyGlobalSSHTypeRequest request) + throws UCloudException { + request.setAction("ModifyGlobalSSHType"); + return (ModifyGlobalSSHTypeResponse) + this.invoke(request, ModifyGlobalSSHTypeResponse.class); + } + + /** + * ModifyUPathBandwidth - 修改加速线路带宽 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyUPathBandwidthResponse modifyUPathBandwidth(ModifyUPathBandwidthRequest request) + throws UCloudException { + request.setAction("ModifyUPathBandwidth"); + return (ModifyUPathBandwidthResponse) + this.invoke(request, ModifyUPathBandwidthResponse.class); + } + + /** + * ModifyUPathTemplate - 修改UPath监控告警项 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyUPathTemplateResponse modifyUPathTemplate(ModifyUPathTemplateRequest request) + throws UCloudException { + request.setAction("ModifyUPathTemplate"); + return (ModifyUPathTemplateResponse) + this.invoke(request, ModifyUPathTemplateResponse.class); + } + + /** + * UGABindUPath - UGA绑定UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public UGABindUPathResponse ugaBindUPath(UGABindUPathRequest request) throws UCloudException { + request.setAction("UGABindUPath"); + return (UGABindUPathResponse) this.invoke(request, UGABindUPathResponse.class); + } + + /** + * UGAUnBindUPath - UGA与UPath解绑 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UGAUnBindUPathResponse ugaUnBindUPath(UGAUnBindUPathRequest request) + throws UCloudException { + request.setAction("UGAUnBindUPath"); + return (UGAUnBindUPathResponse) this.invoke(request, UGAUnBindUPathResponse.class); + } + + /** + * UnBindPathXSSL - 解绑PathX SSL 证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnBindPathXSSLResponse unBindPathXSSL(UnBindPathXSSLRequest request) + throws UCloudException { + request.setAction("UnBindPathXSSL"); + return (UnBindPathXSSLResponse) this.invoke(request, UnBindPathXSSLResponse.class); + } + + /** + * UpdatePathXWhitelist - 更新入口白名单 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdatePathXWhitelistResponse updatePathXWhitelist(UpdatePathXWhitelistRequest request) + throws UCloudException { + request.setAction("UpdatePathXWhitelist"); + return (UpdatePathXWhitelistResponse) + this.invoke(request, UpdatePathXWhitelistResponse.class); + } +} diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClientInterface.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClientInterface.java new file mode 100644 index 00000000..c46f6fba --- /dev/null +++ b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/client/PathXClientInterface.java @@ -0,0 +1,357 @@ +/** + * Copyright 2021 UCloud Technology Co., Ltd. + * + *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *

http://www.apache.org/licenses/LICENSE-2.0 + * + *

Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ +package cn.ucloud.pathx.client; + +import cn.ucloud.common.client.Client; +import cn.ucloud.common.exception.UCloudException; +import cn.ucloud.pathx.models.BindPathXSSLRequest; +import cn.ucloud.pathx.models.BindPathXSSLResponse; +import cn.ucloud.pathx.models.CreateGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.CreateGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.CreatePathXSSLRequest; +import cn.ucloud.pathx.models.CreatePathXSSLResponse; +import cn.ucloud.pathx.models.CreateUGAForwarderRequest; +import cn.ucloud.pathx.models.CreateUGAForwarderResponse; +import cn.ucloud.pathx.models.CreateUGAInstanceRequest; +import cn.ucloud.pathx.models.CreateUGAInstanceResponse; +import cn.ucloud.pathx.models.CreateUPathRequest; +import cn.ucloud.pathx.models.CreateUPathResponse; +import cn.ucloud.pathx.models.DeleteGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.DeleteGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.DeletePathXSSLRequest; +import cn.ucloud.pathx.models.DeletePathXSSLResponse; +import cn.ucloud.pathx.models.DeleteUGAForwarderRequest; +import cn.ucloud.pathx.models.DeleteUGAForwarderResponse; +import cn.ucloud.pathx.models.DeleteUGAInstanceRequest; +import cn.ucloud.pathx.models.DeleteUGAInstanceResponse; +import cn.ucloud.pathx.models.DeleteUPathRequest; +import cn.ucloud.pathx.models.DeleteUPathResponse; +import cn.ucloud.pathx.models.DescribeGlobalSSHInstanceRequest; +import cn.ucloud.pathx.models.DescribeGlobalSSHInstanceResponse; +import cn.ucloud.pathx.models.DescribePathXLineConfigRequest; +import cn.ucloud.pathx.models.DescribePathXLineConfigResponse; +import cn.ucloud.pathx.models.DescribePathXSSLRequest; +import cn.ucloud.pathx.models.DescribePathXSSLResponse; +import cn.ucloud.pathx.models.DescribeUGAInstanceRequest; +import cn.ucloud.pathx.models.DescribeUGAInstanceResponse; +import cn.ucloud.pathx.models.DescribeUPathRequest; +import cn.ucloud.pathx.models.DescribeUPathResponse; +import cn.ucloud.pathx.models.DescribeUPathTemplateRequest; +import cn.ucloud.pathx.models.DescribeUPathTemplateResponse; +import cn.ucloud.pathx.models.GetGlobalSSHPriceRequest; +import cn.ucloud.pathx.models.GetGlobalSSHPriceResponse; +import cn.ucloud.pathx.models.GetGlobalSSHTrafficRequest; +import cn.ucloud.pathx.models.GetGlobalSSHTrafficResponse; +import cn.ucloud.pathx.models.GetGlobalSSHUpdatePriceRequest; +import cn.ucloud.pathx.models.GetGlobalSSHUpdatePriceResponse; +import cn.ucloud.pathx.models.GetPathXMetricRequest; +import cn.ucloud.pathx.models.GetPathXMetricResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHOriginInfoRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHOriginInfoResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHPortRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHPortResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHRemarkRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHRemarkResponse; +import cn.ucloud.pathx.models.ModifyGlobalSSHTypeRequest; +import cn.ucloud.pathx.models.ModifyGlobalSSHTypeResponse; +import cn.ucloud.pathx.models.ModifyUPathBandwidthRequest; +import cn.ucloud.pathx.models.ModifyUPathBandwidthResponse; +import cn.ucloud.pathx.models.ModifyUPathTemplateRequest; +import cn.ucloud.pathx.models.ModifyUPathTemplateResponse; +import cn.ucloud.pathx.models.UGABindUPathRequest; +import cn.ucloud.pathx.models.UGABindUPathResponse; +import cn.ucloud.pathx.models.UGAUnBindUPathRequest; +import cn.ucloud.pathx.models.UGAUnBindUPathResponse; +import cn.ucloud.pathx.models.UnBindPathXSSLRequest; +import cn.ucloud.pathx.models.UnBindPathXSSLResponse; +import cn.ucloud.pathx.models.UpdatePathXWhitelistRequest; +import cn.ucloud.pathx.models.UpdatePathXWhitelistResponse; + +/** This client is used to call actions of **PathX** service */ +public interface PathXClientInterface extends Client { + + /** + * BindPathXSSL - 绑定PathX SSL证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public BindPathXSSLResponse bindPathXSSL(BindPathXSSLRequest request) throws UCloudException; + + /** + * CreateGlobalSSHInstance - 创建GlobalSSH实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateGlobalSSHInstanceResponse createGlobalSSHInstance( + CreateGlobalSSHInstanceRequest request) throws UCloudException; + + /** + * CreatePathXSSL - 创建证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreatePathXSSLResponse createPathXSSL(CreatePathXSSLRequest request) + throws UCloudException; + + /** + * CreateUGAForwarder - 创建加速实例转发器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUGAForwarderResponse createUGAForwarder(CreateUGAForwarderRequest request) + throws UCloudException; + + /** + * CreateUGAInstance - 创建全球加速配置项 + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUGAInstanceResponse createUGAInstance(CreateUGAInstanceRequest request) + throws UCloudException; + + /** + * CreateUPath - 创建UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public CreateUPathResponse createUPath(CreateUPathRequest request) throws UCloudException; + + /** + * DeleteGlobalSSHInstance - 删除GlobalSSH实例 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteGlobalSSHInstanceResponse deleteGlobalSSHInstance( + DeleteGlobalSSHInstanceRequest request) throws UCloudException; + + /** + * DeletePathXSSL - 删除PathX SSL证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeletePathXSSLResponse deletePathXSSL(DeletePathXSSLRequest request) + throws UCloudException; + + /** + * DeleteUGAForwarder - 删除加速实例转发器 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUGAForwarderResponse deleteUGAForwarder(DeleteUGAForwarderRequest request) + throws UCloudException; + + /** + * DeleteUGAInstance - 删除全球加速服务加速配置 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUGAInstanceResponse deleteUGAInstance(DeleteUGAInstanceRequest request) + throws UCloudException; + + /** + * DeleteUPath - 删除UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public DeleteUPathResponse deleteUPath(DeleteUPathRequest request) throws UCloudException; + + /** + * DescribeGlobalSSHInstance - 获取GlobalSSH实例列表 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeGlobalSSHInstanceResponse describeGlobalSSHInstance( + DescribeGlobalSSHInstanceRequest request) throws UCloudException; + + /** + * DescribePathXLineConfig - 获取全球加速线路信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribePathXLineConfigResponse describePathXLineConfig( + DescribePathXLineConfigRequest request) throws UCloudException; + + /** + * DescribePathXSSL - 获取SSL证书信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribePathXSSLResponse describePathXSSL(DescribePathXSSLRequest request) + throws UCloudException; + + /** + * DescribeUGAInstance - 获取全球加速服务加速配置信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUGAInstanceResponse describeUGAInstance(DescribeUGAInstanceRequest request) + throws UCloudException; + + /** + * DescribeUPath - 获取加速线路信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUPathResponse describeUPath(DescribeUPathRequest request) throws UCloudException; + + /** + * DescribeUPathTemplate - 查询UPath的监控模板 + * + * @param request Request object + * @throws UCloudException Exception + */ + public DescribeUPathTemplateResponse describeUPathTemplate(DescribeUPathTemplateRequest request) + throws UCloudException; + + /** + * GetGlobalSSHPrice - 获取GlobalSSH价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHPriceResponse getGlobalSSHPrice(GetGlobalSSHPriceRequest request) + throws UCloudException; + + /** + * GetGlobalSSHTraffic - 获取GlobalSSH流量统计数据 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHTrafficResponse getGlobalSSHTraffic(GetGlobalSSHTrafficRequest request) + throws UCloudException; + + /** + * GetGlobalSSHUpdatePrice - 获取GlobalSSH升级价格 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetGlobalSSHUpdatePriceResponse getGlobalSSHUpdatePrice( + GetGlobalSSHUpdatePriceRequest request) throws UCloudException; + + /** + * GetPathXMetric - 获取全球加速监控信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public GetPathXMetricResponse getPathXMetric(GetPathXMetricRequest request) + throws UCloudException; + + /** + * ModifyGlobalSSHOriginInfo - 修改GlobalSSH 源站信息 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHOriginInfoResponse modifyGlobalSSHOriginInfo( + ModifyGlobalSSHOriginInfoRequest request) throws UCloudException; + + /** + * ModifyGlobalSSHPort - 修改GlobalSSH端口 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHPortResponse modifyGlobalSSHPort(ModifyGlobalSSHPortRequest request) + throws UCloudException; + + /** + * ModifyGlobalSSHRemark - 修改GlobalSSH备注 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHRemarkResponse modifyGlobalSSHRemark(ModifyGlobalSSHRemarkRequest request) + throws UCloudException; + + /** + * ModifyGlobalSSHType - 修改GlobalSSH实例类型 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyGlobalSSHTypeResponse modifyGlobalSSHType(ModifyGlobalSSHTypeRequest request) + throws UCloudException; + + /** + * ModifyUPathBandwidth - 修改加速线路带宽 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyUPathBandwidthResponse modifyUPathBandwidth(ModifyUPathBandwidthRequest request) + throws UCloudException; + + /** + * ModifyUPathTemplate - 修改UPath监控告警项 + * + * @param request Request object + * @throws UCloudException Exception + */ + public ModifyUPathTemplateResponse modifyUPathTemplate(ModifyUPathTemplateRequest request) + throws UCloudException; + + /** + * UGABindUPath - UGA绑定UPath + * + * @param request Request object + * @throws UCloudException Exception + */ + public UGABindUPathResponse ugaBindUPath(UGABindUPathRequest request) throws UCloudException; + + /** + * UGAUnBindUPath - UGA与UPath解绑 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UGAUnBindUPathResponse ugaUnBindUPath(UGAUnBindUPathRequest request) + throws UCloudException; + + /** + * UnBindPathXSSL - 解绑PathX SSL 证书 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UnBindPathXSSLResponse unBindPathXSSL(UnBindPathXSSLRequest request) + throws UCloudException; + + /** + * UpdatePathXWhitelist - 更新入口白名单 + * + * @param request Request object + * @throws UCloudException Exception + */ + public UpdatePathXWhitelistResponse updatePathXWhitelist(UpdatePathXWhitelistRequest request) + throws UCloudException; +} diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskParam.java deleted file mode 100644 index adaf8fb7..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskParam.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 添加加速配置端口 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class AddUGATaskParam extends BaseRequestParam { - /** - * 全球加速实例ID - */ - @UcloudParam("UGAId") - @NotEmpty(message = "uGAId can not be empty") - private String uGAId; - - /** - * tcp端口 - */ - private List tcpPorts; - /** - * udp端口 - */ - private List udpPorts; - - - public AddUGATaskParam(String projectId - , String uGAId - ) { - super("AddUGATask"); - this.projectId = projectId; - this.uGAId = uGAId; - } - - @UcloudParam("TCP") - public List checkTCPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (tcpPorts != null) { - int size = tcpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = tcpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("tcpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("TCP.%d", i), port)); - } - } - return params; - } - - @UcloudParam("UDP") - public List checkUDPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (udpPorts != null) { - int size = udpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = udpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("udpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("UDP.%d", i), port)); - } - } - return params; - } - - - public List getTcpPorts() { - return tcpPorts; - } - - public void setTcpPorts(List tcpPorts) { - this.tcpPorts = tcpPorts; - } - - public List getUdpPorts() { - return udpPorts; - } - - public void setUdpPorts(List udpPorts) { - this.udpPorts = udpPorts; - } - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskResult.java deleted file mode 100644 index 711f03f9..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AddUGATaskResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 添加加速配置端口 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class AddUGATaskResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AlarmRuler.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AlarmRuler.java deleted file mode 100644 index 038d72d4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AlarmRuler.java +++ /dev/null @@ -1,93 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 告警详情 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class AlarmRuler { - /** - * 告警策略ID - */ - @SerializedName("AlarmStrategy") - private String alarmStrategy; - /** - * 比较策略 - */ - @SerializedName("Compare") - private String compare; - /** - * 联系组 - */ - @SerializedName("ContactGroupId") - private Integer contactGroupId; - /** - * 告警项 - */ - @SerializedName("MetricName") - private String metricName; - /** - * 触发阈值 - */ - @SerializedName("Threshold") - private Integer threshold; - /** - * 触发次数 - */ - @SerializedName("TriggerCount") - private Integer triggerCount; - - - public String getAlarmStrategy() { - return this.alarmStrategy; - } - - public void setAlarmStrategy(String alarmStrategy) { - this.alarmStrategy = alarmStrategy; - } - - public String getCompare() { - return this.compare; - } - - public void setCompare(String compare) { - this.compare = compare; - } - - public Integer getContactGroupId() { - return this.contactGroupId; - } - - public void setContactGroupId(Integer contactGroupId) { - this.contactGroupId = contactGroupId; - } - - public String getMetricName() { - return this.metricName; - } - - public void setMetricName(String metricName) { - this.metricName = metricName; - } - - public Integer getThreshold() { - return this.threshold; - } - - public void setThreshold(Integer threshold) { - this.threshold = threshold; - } - - public Integer getTriggerCount() { - return this.triggerCount; - } - - public void setTriggerCount(Integer triggerCount) { - this.triggerCount = triggerCount; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AppleUGAAInfo.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AppleUGAAInfo.java deleted file mode 100644 index af45780d..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/AppleUGAAInfo.java +++ /dev/null @@ -1,154 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 苹果审核加速通道信息 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class AppleUGAAInfo { - /** - * 全球加速ID - */ - @SerializedName("UGAId") - private String uGAId; - /** - * 全球加速cname - */ - @SerializedName("CName") - private String cName; - /** - * 加速源IP列表 - */ - @SerializedName("IPList") - private List iPList; - /** - * 加速实例名称 - */ - @SerializedName("UGAName") - private String uGAName; - /** - * 加速源域名 - */ - @SerializedName("Domain") - private String domain; - /** - * 该UGAA对应的多端口任务配置 - */ - @SerializedName("TaskSet") - private List taskSet; - /** - * 支付类型 - */ - @SerializedName("ChargeType") - private String chargeType; - /** - * 创建时间 - */ - @SerializedName("CreateTime") - private Integer createTime; - /** - * 过期时间 - */ - @SerializedName("ExpireTime") - private Integer expireTime; - - @SerializedName("Location") - private String location; - - @SerializedName("OutPublicIpList") - private List outPublicIpInfos; - - public List getOutPublicIpInfos() { - return outPublicIpInfos; - } - - public void setOutPublicIpInfos(List outPublicIpInfos) { - this.outPublicIpInfos = outPublicIpInfos; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - public String getcName() { - return this.cName; - } - - public void setcName(String cName) { - this.cName = cName; - } - - public List getiPList() { - return this.iPList; - } - - public void setiPList(List iPList) { - this.iPList = iPList; - } - - public String getuGAName() { - return this.uGAName; - } - - public void setuGAName(String uGAName) { - this.uGAName = uGAName; - } - - public String getDomain() { - return this.domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - - public List getTaskSet() { - return this.taskSet; - } - - public void setTaskSet(List taskSet) { - this.taskSet = taskSet; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public Integer getCreateTime() { - return createTime; - } - - public void setCreateTime(Integer createTime) { - this.createTime = createTime; - } - - public Integer getExpireTime() { - return expireTime; - } - - public void setExpireTime(Integer expireTime) { - this.expireTime = expireTime; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceParam.java deleted file mode 100644 index 3aabd55c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceParam.java +++ /dev/null @@ -1,219 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 创建苹果审核加速通道 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateCommonUGAInstanceParam extends BaseRequestParam { - /** - * 购买周期 - */ - @UcloudParam("Quantity") - @NotNull(message = "quantity can not be null") - private Integer quantity; - /** - * 加速地区,AppStore默认是“中国”,GlobalSSH支持“洛杉矶”,“新加坡”,“香港”,“法兰克福”,“东京” - */ - @UcloudParam("Location") - @NotEmpty(message = "location can not be empty") - private String location; - /** - * 计费模式 - */ - @UcloudParam("ChargeType") - @NotEmpty(message = "chargeType can not be empty") - private String chargeType; - /** - * AppStore: 苹果审核加速, GlobalSSH: 全球运维通道 - */ - @UcloudParam("UGAType") - @NotEmpty(message = "uGAType can not be empty") - private String uGAType; - /** - * 加速实例名称 - */ - @UcloudParam("Name") - @NotEmpty(message = "name can not be empty") - private String name; - /** - * 加速源IP,多个IP用逗号隔开(,)隔开;IPList和Domain二选一必填 - */ - @UcloudParam("IPList") - private String iPList; - /** - * 加速源域名;IPList和Domain二选一必填 - */ - @UcloudParam("Domain") - private String domain; - - - /** - * tcp端口 - */ - private List tcpPorts; - /** - * udp端口 - */ - private List udpPorts; - - /** - * globalSSH提供CName的三级域名 - */ - @UcloudParam("PreCName") - private String preCName; - /** - * 代金券 - */ - @UcloudParam("CouponId") - private String couponId; - - - public CreateCommonUGAInstanceParam(String projectId - , Integer quantity - , String location - , String chargeType - , String uGAType - , String name - ) { - super("CreateCommonUGAInstance"); - this.projectId = projectId; - this.quantity = quantity; - this.location = location; - this.chargeType = chargeType; - this.uGAType = uGAType; - this.name = name; - } - - @UcloudParam("TCP") - public List checkTCPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (tcpPorts != null) { - int size = tcpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = tcpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("tcpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("TCP.%d", i), port)); - } - } - return params; - } - - @UcloudParam("UDP") - public List checkUDPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (udpPorts != null) { - int size = udpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = udpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("udpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("UDP.%d", i), port)); - } - } - return params; - } - public List getTcpPorts() { - return tcpPorts; - } - - public void setTcpPorts(List tcpPorts) { - this.tcpPorts = tcpPorts; - } - - public List getUdpPorts() { - return udpPorts; - } - - public void setUdpPorts(List udpPorts) { - this.udpPorts = udpPorts; - } - - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getLocation() { - return this.location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public String getuGAType() { - return this.uGAType; - } - - public void setuGAType(String uGAType) { - this.uGAType = uGAType; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getiPList() { - return this.iPList; - } - - public void setiPList(String iPList) { - this.iPList = iPList; - } - - public String getDomain() { - return this.domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public String getPreCName() { - return this.preCName; - } - - public void setPreCName(String preCName) { - this.preCName = preCName; - } - - public String getCouponId() { - return this.couponId; - } - - public void setCouponId(String couponId) { - this.couponId = couponId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceResult.java deleted file mode 100644 index 9835ccb7..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateCommonUGAInstanceResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 创建苹果审核加速通道 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateCommonUGAInstanceResult extends BaseResponseResult { - /** - * 全球加速ID - */ - @SerializedName("UGAId") - private String uGAId; - /** - * 全球加速cname - */ - @SerializedName("CName") - private String cName; - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - public String getcName() { - return this.cName; - } - - public void setcName(String cName) { - this.cName = cName; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceParam.java deleted file mode 100644 index 6fda4836..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceParam.java +++ /dev/null @@ -1,142 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 创建GlobalSSH实例 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateGlobalSSHInstanceParam extends BaseRequestParam { - /** - * 填写支持SSH访问IP的地区名称,如“洛杉矶”,“新加坡”,“香港”,“东京”,“华盛顿”,“法兰克福”。Area和AreaCode两者必填一个 - */ - @UcloudParam("Area") - @NotEmpty(message = "area can not be empty") - private String area; - /** - * 被SSH访问的IP - */ - @UcloudParam("TargetIP") - @NotEmpty(message = "targetIP can not be empty") - private String targetIP; - /** - * SSH端口,1-65535且不能使用80,443端口 - */ - @UcloudParam("Port") - @NotNull(message = "port can not be null") - private Integer port; - /** - * AreaCode, 区域航空港国际通用代码。Area和AreaCode两者必填一个 - */ - @UcloudParam("AreaCode") - @NotEmpty(message = "areaCode can not be empty") - private String areaCode; - /** - * 备注信息 - */ - @UcloudParam("Remark") - private String remark; - /** - * 支付方式,如按月、按年、按时 - */ - @UcloudParam("ChargeType") - private String chargeType; - /** - * 购买数量 - */ - @UcloudParam("Quantity") - private Integer quantity; - /** - * 使用代金券可冲抵部分费用 - */ - @UcloudParam("CouponId") - private String couponId; - - - public CreateGlobalSSHInstanceParam(String projectId - , String area - , String targetIP - , Integer port - , String areaCode - ) { - super("CreateGlobalSSHInstance"); - this.projectId = projectId; - this.area = area; - this.targetIP = targetIP; - this.port = port; - this.areaCode = areaCode; - } - - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getTargetIP() { - return this.targetIP; - } - - public void setTargetIP(String targetIP) { - this.targetIP = targetIP; - } - - public Integer getPort() { - return this.port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public String getAreaCode() { - return this.areaCode; - } - - public void setAreaCode(String areaCode) { - this.areaCode = areaCode; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public Integer getQuantity() { - return this.quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getCouponId() { - return this.couponId; - } - - public void setCouponId(String couponId) { - this.couponId = couponId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceResult.java deleted file mode 100644 index 39d4d6d0..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateGlobalSSHInstanceResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 创建GlobalSSH实例 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateGlobalSSHInstanceResult extends BaseResponseResult { - /** - * 实例ID,资源唯一标识 - */ - @SerializedName("InstanceId") - private String instanceId; - /** - * 加速域名,访问该域名可就近接入 - */ - @SerializedName("AcceleratingDomain") - private String acceleratingDomain; - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getAcceleratingDomain() { - return this.acceleratingDomain; - } - - public void setAcceleratingDomain(String acceleratingDomain) { - this.acceleratingDomain = acceleratingDomain; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceParam.java deleted file mode 100644 index 9a0ba2df..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceParam.java +++ /dev/null @@ -1,173 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 创建全球加速配置项 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateUGAInstanceParam extends BaseRequestParam { - /** - * 加速实例名称 - */ - @UcloudParam("Name") - @NotEmpty(message = "name can not be empty") - private String name; - /** - * 加速源IP,多个IP用逗号隔开(,)隔开;IPList和Domain二选一必填 - */ - @UcloudParam("IPList") - private String iPList; - /** - * 加速源域名;IPList和Domain二选一必填 - */ - @UcloudParam("Domain") - private String domain; - - @UcloudParam("ChargeType") - private String chargeType; - - @UcloudParam("Quantity") - private Integer quantity; - - @UcloudParam("IsHighNet") - private Boolean isHighNet; - - @NotEmpty(message = "location can not be empty") - @UcloudParam("Location") - private String location; - - /** - * tcp端口 - */ - private List tcpPorts; - /** - * udp端口 - */ - private List udpPorts; - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public Boolean getHighNet() { - return isHighNet; - } - - public void setHighNet(Boolean highNet) { - isHighNet = highNet; - } - - public CreateUGAInstanceParam(String projectId - , String name, String location - ) { - super("CreateUGAInstance"); - this.projectId = projectId; - this.name = name; - this.location = location; - } - - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getChargeType() { - return chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - @UcloudParam("TCP") - public List checkTCPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (tcpPorts != null) { - int size = tcpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = tcpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("tcpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("TCP.%d", i), port)); - } - } - return params; - } - - @UcloudParam("UDP") - public List checkUDPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (udpPorts != null) { - int size = udpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = udpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("udpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("UDP.%d", i), port)); - } - } - return params; - } - - - public List getTcpPorts() { - return tcpPorts; - } - - public void setTcpPorts(List tcpPorts) { - this.tcpPorts = tcpPorts; - } - - public List getUdpPorts() { - return udpPorts; - } - - public void setUdpPorts(List udpPorts) { - this.udpPorts = udpPorts; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getiPList() { - return this.iPList; - } - - public void setiPList(String iPList) { - this.iPList = iPList; - } - - public String getDomain() { - return this.domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceResult.java deleted file mode 100644 index a10b1723..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUGAInstanceResult.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 创建全球加速配置项 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateUGAInstanceResult extends BaseResponseResult { - /** - * 加速配置ID - */ - @SerializedName("UGAId") - private String uGAId; - /** - * 加速域名 用户可把业务域名CName到此域名上。注意:未绑定线路情况时 加速域名解析不出IP。 - */ - @SerializedName("CName") - private String cName; - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - public String getcName() { - return this.cName; - } - - public void setcName(String cName) { - this.cName = cName; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathParam.java deleted file mode 100644 index c890f2ae..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathParam.java +++ /dev/null @@ -1,119 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 创建UPath 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateUPathParam extends BaseRequestParam { - /** - * UPath名字 - */ - @UcloudParam("Name") - @NotEmpty(message = "name can not be empty") - private String name; - /** - * 线路Id - */ - @UcloudParam("LineId") - @NotEmpty(message = "lineId can not be empty") - private String lineId; - /** - * UPath带宽 - */ - @UcloudParam("Bandwidth") - @NotNull(message = "bandwidth can not be null") - private Integer bandwidth; - /** - * 计费模式 - */ - @UcloudParam("ChargeType") - @NotEmpty(message = "chargeType can not be empty") - private String chargeType; - /** - * 购买周期 - */ - @UcloudParam("Quantity") - @NotNull(message = "quantity can not be null") - private Integer quantity; - /** - * 代金券Id - */ - @UcloudParam("CouponId") - private String couponId; - - - public CreateUPathParam(String projectId - , String name - , String lineId - , Integer bandwidth - , String chargeType - , Integer quantity - ) { - super("CreateUPath"); - this.projectId = projectId; - this.name = name; - this.lineId = lineId; - this.bandwidth = bandwidth; - this.chargeType = chargeType; - this.quantity = quantity; - } - - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLineId() { - return this.lineId; - } - - public void setLineId(String lineId) { - this.lineId = lineId; - } - - public Integer getBandwidth() { - return this.bandwidth; - } - - public void setBandwidth(Integer bandwidth) { - this.bandwidth = bandwidth; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getCouponId() { - return this.couponId; - } - - public void setCouponId(String couponId) { - this.couponId = couponId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathResult.java deleted file mode 100644 index 91cd29a6..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/CreateUPathResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 创建UPath 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class CreateUPathResult extends BaseResponseResult { - /** - * 加速线路Id - */ - @SerializedName("UPathId") - private String uPathId; - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceParam.java deleted file mode 100644 index 501655c4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 删除苹果加速通道 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteCommonUGAInstanceParam extends BaseRequestParam { - /** - * 全球加速实例ID - */ - @UcloudParam("UGAId") - @NotEmpty(message = "uGAId can not be empty") - private String uGAId; - /** - * AppStore: 苹果审核加速, GlobalSSH: 全球运维通道 - */ - @UcloudParam("UGAType") - @NotEmpty(message = "uGAType can not be empty") - private String uGAType; - - - public DeleteCommonUGAInstanceParam(String projectId - , String uGAId - , String uGAType - ) { - super("DeleteCommonUGAInstance"); - this.projectId = projectId; - this.uGAId = uGAId; - this.uGAType = uGAType; - } - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - public String getuGAType() { - return this.uGAType; - } - - public void setuGAType(String uGAType) { - this.uGAType = uGAType; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceResult.java deleted file mode 100644 index fd419057..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteCommonUGAInstanceResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 删除苹果加速通道 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteCommonUGAInstanceResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceParam.java deleted file mode 100644 index 31434618..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceParam.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 删除GlobalSSH实例 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteGlobalSSHInstanceParam extends BaseRequestParam { - /** - * 实例Id,资源的唯一标识 - */ - @UcloudParam("InstanceId") - @NotEmpty(message = "instanceId can not be empty") - private String instanceId; - - - public DeleteGlobalSSHInstanceParam(String projectId - , String instanceId - ) { - super("DeleteGlobalSSHInstance"); - this.projectId = projectId; - this.instanceId = instanceId; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceResult.java deleted file mode 100644 index 96ee8a52..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteGlobalSSHInstanceResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 删除GlobalSSH实例 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteGlobalSSHInstanceResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceParam.java deleted file mode 100644 index f212c85b..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceParam.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 删除全球加速服务加速配置 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUGAInstanceParam extends BaseRequestParam { - /** - * 全球加速实例ID - */ - @UcloudParam("UGAId") - @NotEmpty(message = "uGAId can not be empty") - private String uGAId; - - - public DeleteUGAInstanceParam(String projectId - , String uGAId - ) { - super("DeleteUGAInstance"); - this.projectId = projectId; - this.uGAId = uGAId; - } - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceResult.java deleted file mode 100644 index 50cf885c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGAInstanceResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 删除全球加速服务加速配置 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUGAInstanceResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskParam.java deleted file mode 100644 index 6f9f5895..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskParam.java +++ /dev/null @@ -1,101 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 删除加速配置端口 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUGATaskParam extends BaseRequestParam { - /** - * 全球加速实例ID - */ - @UcloudParam("UGAId") - @NotEmpty(message = "uGAId can not be empty") - private String uGAId; - - /** - * tcp端口 - */ - private List tcpPorts; - /** - * udp端口 - */ - private List udpPorts; - - - public DeleteUGATaskParam(String projectId - , String uGAId - ) { - super("DeleteUGATask"); - this.projectId = projectId; - this.uGAId = uGAId; - } - @UcloudParam("TCP") - public List checkTCPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (tcpPorts != null) { - int size = tcpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = tcpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("tcpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("TCP.%d", i), port)); - } - } - return params; - } - - @UcloudParam("UDP") - public List checkUDPPorts() throws ValidationException { - List params = new ArrayList<>(); - if (udpPorts != null) { - int size = udpPorts.size(); - for (int i = 0; i < size; i++) { - Integer port = udpPorts.get(i); - if (port == null) { - throw new ValidationException(String.format("udpPorts[%d] can not be null", i)); - } - params.add(new Param(String.format("UDP.%d", i), port)); - } - } - return params; - } - - public List getTcpPorts() { - return tcpPorts; - } - - public void setTcpPorts(List tcpPorts) { - this.tcpPorts = tcpPorts; - } - - public List getUdpPorts() { - return udpPorts; - } - - public void setUdpPorts(List udpPorts) { - this.udpPorts = udpPorts; - } - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskResult.java deleted file mode 100644 index 84cefa5c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUGATaskResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 删除加速配置端口 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUGATaskResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathParam.java deleted file mode 100644 index a27795aa..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathParam.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 删除UPath 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUPathParam extends BaseRequestParam { - /** - * 加速线路id - */ - @UcloudParam("UPathId") - @NotEmpty(message = "uPathId can not be empty") - private String uPathId; - - - public DeleteUPathParam(String projectId - , String uPathId - ) { - super("DeleteUPath"); - this.projectId = projectId; - this.uPathId = uPathId; - } - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathResult.java deleted file mode 100644 index df23aee4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DeleteUPathResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 删除UPath 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DeleteUPathResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceParam.java deleted file mode 100644 index 1c049011..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceParam.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 获取苹果加速通道信息 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeCommonUGAInstanceParam extends BaseRequestParam { - /** - * AppStore: 苹果审核加速, GlobalSSH: 全球运维通道 - */ - @UcloudParam("UGAType") - @NotEmpty(message = "uGAType can not be empty") - private String uGAType; - /** - * 全球加速实例ID - */ - @UcloudParam("UGAId") - private String uGAId; - - - public DescribeCommonUGAInstanceParam(String projectId - , String uGAType - ) { - super("DescribeCommonUGAInstance"); - this.projectId = projectId; - this.uGAType = uGAType; - } - - - public String getuGAType() { - return this.uGAType; - } - - public void setuGAType(String uGAType) { - this.uGAType = uGAType; - } - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceResult.java deleted file mode 100644 index 255537ab..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeCommonUGAInstanceResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取苹果加速通道信息 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeCommonUGAInstanceResult extends BaseResponseResult { - /** - * 全球加速实例信息列表 - */ - @SerializedName("UGAList") - private List uGAAList; - - - public List getuGAAList() { - return this.uGAAList; - } - - public void setuGAAList(List uGAAList) { - this.uGAAList = uGAAList; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaParam.java deleted file mode 100644 index 8cd64535..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaParam.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取GlobalSSH覆盖的地区列表 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeGlobalSSHAreaParam extends BaseRequestParam { - /** - * 机房地域代号,如hk、 us-ca、 us-ws等。不填默认为空,返回所有支持地区。 - */ - @UcloudParam("Region") - private String region; - - - public DescribeGlobalSSHAreaParam() { - super("DescribeGlobalSSHArea"); - } - - - public String getRegion() { - return this.region; - } - - public void setRegion(String region) { - this.region = region; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaResult.java deleted file mode 100644 index ad0f886e..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHAreaResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取GlobalSSH覆盖的地区列表 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeGlobalSSHAreaResult extends BaseResponseResult { - /** - * 支持GlobalSSH的地区 - */ - @SerializedName("AreaSet") - private List areaSet; - - - public List getAreaSet() { - return this.areaSet; - } - - public void setAreaSet(List areaSet) { - this.areaSet = areaSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceParam.java deleted file mode 100644 index e13b84bc..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取GlobalSSH实例列表 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeGlobalSSHInstanceParam extends BaseRequestParam { - /** - * 实例ID,资源唯一标识 - */ - @UcloudParam("InstanceId") - private String instanceId; - - - public DescribeGlobalSSHInstanceParam(String projectId - ) { - super("DescribeGlobalSSHInstance"); - this.projectId = projectId; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceResult.java deleted file mode 100644 index 825c50ea..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeGlobalSSHInstanceResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取GlobalSSH实例列表 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeGlobalSSHInstanceResult extends BaseResponseResult { - /** - * GlobalSSH实例列表,实例的属性参考GlobalSSHInfo模型 - */ - @SerializedName("InstanceSet") - private List instanceSet; - - - public List getInstanceSet() { - return this.instanceSet; - } - - public void setInstanceSet(List instanceSet) { - this.instanceSet = instanceSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigParam.java deleted file mode 100644 index 270ae269..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigParam.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取全球加速线路信息 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribePathXLineConfigParam extends BaseRequestParam { - - - public DescribePathXLineConfigParam() { - super("DescribePathXLineConfig"); - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigResult.java deleted file mode 100644 index c1ea81c6..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXLineConfigResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取全球加速线路信息 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribePathXLineConfigResult extends BaseResponseResult { - /** - * UGAA线路列表 - */ - @SerializedName("LineSet") - private List lineSet; - - - public List getLineSet() { - return this.lineSet; - } - - public void setLineSet(List lineSet) { - this.lineSet = lineSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistParam.java deleted file mode 100644 index cf34063a..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取入口白名单列表 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribePathXWhitelistParam extends BaseRequestParam { - /** - * 实例ID, 不填返回项目下全部实例配置的白名单规则 - */ - @UcloudParam("InstanceId") - private String instanceId; - - - public DescribePathXWhitelistParam(String projectId - ) { - super("DescribePathXWhitelist"); - this.projectId = projectId; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistResult.java deleted file mode 100644 index 89976886..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribePathXWhitelistResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取入口白名单列表 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribePathXWhitelistResult extends BaseResponseResult { - /** - * 实例白名单规则列表 - */ - @SerializedName("WhitelistSet") - private List whitelistSet; - - - public List getWhitelistSet() { - return this.whitelistSet; - } - - public void setWhitelistSet(List whitelistSet) { - this.whitelistSet = whitelistSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceParam.java deleted file mode 100644 index 484b66f4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取全球加速服务加速配置信息 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUGAInstanceParam extends BaseRequestParam { - /** - * 全球加速实例ID - */ - @UcloudParam("UGAAId") - private String uGAAId; - - - public DescribeUGAInstanceParam(String projectId - ) { - super("DescribeUGAInstance"); - this.projectId = projectId; - } - - - public String getuGAAId() { - return this.uGAAId; - } - - public void setuGAAId(String uGAAId) { - this.uGAAId = uGAAId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceResult.java deleted file mode 100644 index e1e5ab84..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUGAInstanceResult.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取全球加速服务加速配置信息 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUGAInstanceResult extends BaseResponseResult { - /** - * 全球加速实例信息列表 - */ - @SerializedName("UGAList") - private List uGAList; - - /** - * 总数 - */ - @SerializedName("TotalCount") - private Integer totalCount; - - - public List getuGAList() { - return this.uGAList; - } - - public void setuGAList(List uGAList) { - this.uGAList = uGAList; - } - - public Integer getTotalCount() { - return totalCount; - } - - public void setTotalCount(Integer totalCount) { - this.totalCount = totalCount; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathParam.java deleted file mode 100644 index 7ea21016..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取加速线路信息 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUPathParam extends BaseRequestParam { - /** - * 不填 返回所填项目下所有的线路资源,填写则返回一个线路实例 - */ - @UcloudParam("UPathId") - private String uPathId; - - - public DescribeUPathParam(String projectId - ) { - super("DescribeUPath"); - this.projectId = projectId; - } - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathResult.java deleted file mode 100644 index f132654c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取加速线路信息 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUPathResult extends BaseResponseResult { - /** - * 线路信息数组 - */ - @SerializedName("UPathSet") - private List uPathSet; - - - public List getuPathSet() { - return this.uPathSet; - } - - public void setuPathSet(List uPathSet) { - this.uPathSet = uPathSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateParam.java deleted file mode 100644 index 06d843a7..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateParam.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 查询UPath的监控模板 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUPathTemplateParam extends BaseRequestParam { - /** - * 加速线路ID - */ - @UcloudParam("UPathId") - @NotEmpty(message = "uPathId can not be empty") - private String uPathId; - - - public DescribeUPathTemplateParam(String projectId - , String uPathId - ) { - super("DescribeUPathTemplate"); - this.projectId = projectId; - this.uPathId = uPathId; - } - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateResult.java deleted file mode 100644 index 3908a715..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/DescribeUPathTemplateResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 查询UPath的监控模板 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class DescribeUPathTemplateResult extends BaseResponseResult { - /** - * 监控模板详情 - */ - @SerializedName("DataSet") - private List dataSet; - - - public List getDataSet() { - return this.dataSet; - } - - public void setDataSet(List dataSet) { - this.dataSet = dataSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceParam.java deleted file mode 100644 index b6e13b9a..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceParam.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - - -/** - * @Description : 获取苹果加速通道价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetCommonUGAPriceParam extends BaseRequestParam { - /** - * 购买周期 - */ - @UcloudParam("Quantity") - private Integer quantity; - /** - * 计费模式 - */ - @UcloudParam("ChargeType") - private String chargeType; - - - public GetCommonUGAPriceParam(String projectId - ) { - super("GetCommonUGAPrice"); - this.projectId = projectId; - } - - - public Integer getQuantity() { - return this.quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceResult.java deleted file mode 100644 index d23d1d99..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetCommonUGAPriceResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.math.BigDecimal; - - -/** - * @Description : 获取苹果加速通道价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetCommonUGAPriceResult extends BaseResponseResult { - /** - * 价格 - */ - @SerializedName("Price") - private BigDecimal price; - - - public BigDecimal getPrice() { - return this.price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricParam.java deleted file mode 100644 index f3107adb..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取GlobalSSH出入带宽数据 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHMetricParam extends BaseRequestParam { - /** - * 实例ID,资源唯一标识 - */ - @UcloudParam("InstanceId") - @NotEmpty(message = "instanceId can not be empty") - private String instanceId; - /** - * 起始时间戳(unix格式,如1531834598) - */ - @UcloudParam("BeginTime") - @NotNull(message = "beginTime can not be null") - private Integer beginTime; - /** - * 结束时间戳(unix格式,如1531886362) - */ - @UcloudParam("EndTime") - @NotNull(message = "endTime can not be null") - private Integer endTime; - - - public GetGlobalSSHMetricParam(String instanceId - , Integer beginTime - , Integer endTime - ) { - super("GetGlobalSSHMetric"); - this.instanceId = instanceId; - this.beginTime = beginTime; - this.endTime = endTime; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public Integer getBeginTime() { - return this.beginTime; - } - - public void setBeginTime(Integer beginTime) { - this.beginTime = beginTime; - } - - public Integer getEndTime() { - return this.endTime; - } - - public void setEndTime(Integer endTime) { - this.endTime = endTime; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricResult.java deleted file mode 100644 index 38d8d4ed..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHMetricResult.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取GlobalSSH出入带宽数据 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHMetricResult extends BaseResponseResult { - /** - * 相关指标,如带宽等 - */ - @SerializedName("Metrics") - private GlobalSSHMetric metrics; - - public GlobalSSHMetric getMetrics() { - return metrics; - } - - public void setMetrics(GlobalSSHMetric metrics) { - this.metrics = metrics; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceParam.java deleted file mode 100644 index bce0d862..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取GlobalSSH价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHPriceParam extends BaseRequestParam { - /** - * 购买周期 - */ - @UcloudParam("Quantity") - @NotNull(message = "quantity can not be null") - private Integer quantity; - /** - * 计费类型:Dynamic,Month,Year - */ - @UcloudParam("ChargeType") - @NotEmpty(message = "chargeType can not be empty") - private String chargeType; - - - public GetGlobalSSHPriceParam(Integer quantity - , String chargeType - ) { - super("GetGlobalSSHPrice"); - this.quantity = quantity; - this.chargeType = chargeType; - } - - - public Integer getQuantity() { - return this.quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceResult.java deleted file mode 100644 index 1a28f252..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHPriceResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 获取GlobalSSH价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHPriceResult extends BaseResponseResult { - /** - * 价格,返回单位为元 - */ - @SerializedName("Price") - private Double price; - - - public Double getPrice() { - return this.price; - } - - public void setPrice(Double price) { - this.price = price; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficParam.java deleted file mode 100644 index e6cf93a0..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficParam.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取全球运维通道流量统计数据 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHTrafficParam extends BaseRequestParam { - /** - * 资源ID,如uga-as5daw - */ - @UcloudParam("UGAId") - @NotEmpty(message = "uGAId can not be empty") - private String uGAId; - /** - * 查询起始时间,如1525017600 - */ - @UcloudParam("BeginTime") - @NotNull(message = "beginTime can not be null") - private Integer beginTime; - /** - * 查询结束时间,如1525103999 - */ - @UcloudParam("EndTime") - @NotNull(message = "endTime can not be null") - private Integer endTime; - - - public GetGlobalSSHTrafficParam(String projectId - , String uGAId - , Integer beginTime - , Integer endTime - ) { - super("GetGlobalSSHTraffic"); - this.projectId = projectId; - this.uGAId = uGAId; - this.beginTime = beginTime; - this.endTime = endTime; - } - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - public Integer getBeginTime() { - return this.beginTime; - } - - public void setBeginTime(Integer beginTime) { - this.beginTime = beginTime; - } - - public Integer getEndTime() { - return this.endTime; - } - - public void setEndTime(Integer endTime) { - this.endTime = endTime; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficResult.java deleted file mode 100644 index 3ceb73dc..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetGlobalSSHTrafficResult.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取全球运维通道流量统计数据 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetGlobalSSHTrafficResult extends BaseResponseResult { - /** - * 资源ID - */ - @SerializedName("UGAId") - private String uGAId; - /** - * 流量统计数据 - */ - @SerializedName("DataSet") - private List dataSet; - - - public String getuGAId() { - return this.uGAId; - } - - public void setuGAId(String uGAId) { - this.uGAId = uGAId; - } - - - public List getDataSet() { - return this.dataSet; - } - - public void setDataSet(List dataSet) { - this.dataSet = dataSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricParam.java deleted file mode 100644 index 9945f090..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricParam.java +++ /dev/null @@ -1,143 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 获取全球加速监控信息 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetPathXMetricParam extends BaseRequestParam { - /** - * ResourceId,如upath ID 和 uga ID - */ - @UcloudParam("ResourceId") - @NotEmpty(message = "resourceId can not be empty") - private String resourceId; - /** - * 查询起始时间 - */ - @UcloudParam("BeginTime") - @NotNull(message = "beginTime can not be null") - private Integer beginTime; - /** - * 查询结束时间 - */ - @UcloudParam("EndTime") - @NotNull(message = "endTime can not be null") - private Integer endTime; - - /** - * 查询的监控项,以逗号分隔,拼接成一个字符串。 - * 目前仅允许一下内容: - * NetworkOut:出口带宽, - * NetworkIn:入口带宽, - * NetworkOutUsage:出口使用率, - * NetworkInUsage:入口使用率, - * TCPDelay:tcp延迟, - * InputRetransmitRate:输入重传率, - * OutputRetransmitRate:输出重传率; - * TCPConNum:tcp连接数 - */ - private List metricNames; - - /** - * upath:加速线路,uga:加速实例 - */ - @UcloudParam("ResourceType") - @NotEmpty(message = "resourceType can not be empty") - private String resourceType; - /** - * 具体线路id - */ - @UcloudParam("LineId") - @NotEmpty(message = "lineId can not be empty") - private String lineId; - - - public GetPathXMetricParam(String projectId - , String resourceId - , Integer beginTime - , Integer endTime - , String resourceType - , String lineId, List metricNames - ) { - super("GetPathXMetric"); - this.projectId = projectId; - this.resourceId = resourceId; - this.beginTime = beginTime; - this.endTime = endTime; - this.metricNames = metricNames; - this.resourceType = resourceType; - this.lineId = lineId; - } - - @UcloudParam("MetricName") - public List checkMetricNames() throws ValidationException { - List params = new ArrayList<>(); - if (metricNames == null || metricNames.isEmpty()) { - throw new ValidationException("metricNames can not be empty"); - } - int size = metricNames.size(); - for (int i = 0; i < size; i++) { - String name = metricNames.get(i); - if (name == null || name.length() <= 0){ - throw new ValidationException(String.format("metricNames[%d] can not be empty",i)); - } - params.add(new Param(String.format("MetricName.%d",i),name)); - } - return params; - } - - - public String getResourceId() { - return this.resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public Integer getBeginTime() { - return this.beginTime; - } - - public void setBeginTime(Integer beginTime) { - this.beginTime = beginTime; - } - - public Integer getEndTime() { - return this.endTime; - } - - public void setEndTime(Integer endTime) { - this.endTime = endTime; - } - - public String getResourceType() { - return this.resourceType; - } - - public void setResourceType(String resourceType) { - this.resourceType = resourceType; - } - - public String getLineId() { - return this.lineId; - } - - public void setLineId(String lineId) { - this.lineId = lineId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricResult.java deleted file mode 100644 index bd2ab35b..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetPathXMetricResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取全球加速监控信息 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetPathXMetricResult extends BaseResponseResult { - /** - * - */ - @SerializedName("DataSet") - private MetricPeriod dataSet; - - - public MetricPeriod getDataSet() { - return dataSet; - } - - public void setDataSet(MetricPeriod dataSet) { - this.dataSet = dataSet; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceParam.java deleted file mode 100644 index 7a0d947c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceParam.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取UGA价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUGAPriceParam extends BaseRequestParam { - /** - * 绑定到UPath的数量 - */ - @UcloudParam("UPathNum") - @NotNull(message = "uPathNum can not be null") - private Integer uPathNum; - /** - * 购买周期 - */ - @UcloudParam("Quantity") - private Integer quantity; - /** - * 计费类型 - */ - @UcloudParam("ChargeType") - private String chargeType; - - - public GetUGAPriceParam(String projectId - , Integer uPathNum - ) { - super("GetUGAPrice"); - this.projectId = projectId; - this.uPathNum = uPathNum; - } - - - public Integer getuPathNum() { - return this.uPathNum; - } - - public void setuPathNum(Integer uPathNum) { - this.uPathNum = uPathNum; - } - - public Integer getQuantity() { - return this.quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceResult.java deleted file mode 100644 index 41836b09..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAPriceResult.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取UGA价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUGAPriceResult extends BaseResponseResult { - /** - * 价格 - */ - @SerializedName("PriceSet") - private List prices; - - public List getPrices() { - return prices; - } - - public void setPrices(List prices) { - this.prices = prices; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceParam.java deleted file mode 100644 index e7b38dc3..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取UGA更新价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUGAUpdatePriceParam extends BaseRequestParam { - /** - * - */ - @UcloudParam("UPathNum") - @NotNull(message = "uPathNum can not be null") - private Integer uPathNum; - /** - * - */ - @NotEmpty(message = "resourceId can not be empty") - @UcloudParam("ResourceId") - private String resourceId; - - - - public GetUGAUpdatePriceParam(String projectId - , Integer uPathNum,String resourceId - ) { - super("GetUGAUpdatePrice"); - this.projectId = projectId; - this.uPathNum = uPathNum; - this.resourceId = resourceId; - } - - public Integer getuPathNum() { - return this.uPathNum; - } - - public void setuPathNum(Integer uPathNum) { - this.uPathNum = uPathNum; - } - - public String getResourceId() { - return this.resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceResult.java deleted file mode 100644 index 0e6d8763..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUGAUpdatePriceResult.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 获取UGA更新价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUGAUpdatePriceResult extends BaseResponseResult { - /** - * - */ - @SerializedName("Price") - private Double price; - - - public Double getPrice() { - return price; - } - - public void setPrice(Double price) { - this.price = price; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceParam.java deleted file mode 100644 index a7924502..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceParam.java +++ /dev/null @@ -1,90 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取UPath价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUPathPriceParam extends BaseRequestParam { - /** - * 带宽(Mbps) - */ - @UcloudParam("Bandwidth") - @NotNull(message = "bandwidth can not be null") - private Integer bandwidth; - /** - * - */ - @UcloudParam("Quantity") - @NotNull(message = "quantity can not be null") - private Integer quantity; - /** - * - */ - @UcloudParam("ChargeType") - @NotEmpty(message = "chargeType can not be empty") - private String chargeType; - /** - * - */ - @UcloudParam("LineId") - @NotEmpty(message = "lineId can not be empty") - private String lineId; - - - public GetUPathPriceParam(String projectId - , Integer bandwidth - , Integer quantity - , String chargeType - , String lineId - ) { - super("GetUPathPrice"); - this.projectId = projectId; - this.bandwidth = bandwidth; - this.quantity = quantity; - this.chargeType = chargeType; - this.lineId = lineId; - } - - - public Integer getBandwidth() { - return this.bandwidth; - } - - public void setBandwidth(Integer bandwidth) { - this.bandwidth = bandwidth; - } - - public Integer getQuantity() { - return this.quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public String getLineId() { - return this.lineId; - } - - public void setLineId(String lineId) { - this.lineId = lineId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceResult.java deleted file mode 100644 index fe587789..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathPriceResult.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 获取UPath价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUPathPriceResult extends BaseResponseResult { - /** - * - */ - @SerializedName("PriceSet") - private List price; - - public List getPrice() { - return price; - } - - public void setPrice(List price) { - this.price = price; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceParam.java deleted file mode 100644 index 4c570d24..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceParam.java +++ /dev/null @@ -1,74 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 获取UPath升级价格 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUPathUpdatePriceParam extends BaseRequestParam { - /** - * - */ - @UcloudParam("ResourceId") - @NotEmpty(message = "resourceId can not be empty") - private String resourceId; - /** - * - */ - @UcloudParam("Bandwidth") - @NotNull(message = "bandwidth can not be null") - private Integer bandwidth; - /** - * - */ - @NotEmpty(message = "lineId can not be empty") - @UcloudParam("LineId") - private String lineId; - - - public GetUPathUpdatePriceParam(String projectId - , String resourceId - , Integer bandwidth - , String lineId - ) { - super("GetUPathUpdatePrice"); - this.projectId = projectId; - this.resourceId = resourceId; - this.bandwidth = bandwidth; - this.lineId = lineId; - } - - - public String getResourceId() { - return this.resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - public Integer getBandwidth() { - return this.bandwidth; - } - - public void setBandwidth(Integer bandwidth) { - this.bandwidth = bandwidth; - } - - public String getLineId() { - return this.lineId; - } - - public void setLineId(String lineId) { - this.lineId = lineId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceResult.java deleted file mode 100644 index 2786786c..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GetUPathUpdatePriceResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 获取UPath升级价格 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GetUPathUpdatePriceResult extends BaseResponseResult { - /** - * - */ - @SerializedName("Price") - private Double price; - - - public Double getPrice() { - return this.price; - } - - public void setPrice(Double price) { - this.price = price; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHArea.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHArea.java deleted file mode 100644 index d3dcb0e9..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHArea.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : GlobalSSH覆盖地区,包括关联的UCloud机房信息 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GlobalSSHArea { - /** - * GlobalSSH覆盖的地区,如香港、东京、洛杉矶等 - */ - @SerializedName("Area") - private String area; - /** - * 地区代号,以地区AirPort Code - */ - @SerializedName("AreaCode") - private String areaCode; - /** - * ucloud机房代号构成的数组,如["hk","us-ca"] - */ - @SerializedName("RegionSet") - private List regionSet; - - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getAreaCode() { - return this.areaCode; - } - - public void setAreaCode(String areaCode) { - this.areaCode = areaCode; - } - - public List getRegionSet() { - return this.regionSet; - } - - public void setRegionSet(List regionSet) { - this.regionSet = regionSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHInfo.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHInfo.java deleted file mode 100644 index d3217b08..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHInfo.java +++ /dev/null @@ -1,144 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : GlobalSSH实例信息 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GlobalSSHInfo { - /** - * 实例ID,资源唯一标识 - */ - @SerializedName("InstanceId") - private String instanceId; - /** - * 加速域名 - */ - @SerializedName("AcceleratingDomain") - private String acceleratingDomain; - /** - * 被SSH访问的IP所在地区 - */ - @SerializedName("Area") - private String area; - /** - * 被SSH访问的EIP - */ - @SerializedName("TargetIP") - private String targetIP; - /** - * 备注信息 - */ - @SerializedName("Remark") - private String remark; - /** - * SSH登陆端口 - */ - @SerializedName("Port") - private Integer port; - /** - * 支付周期,如Month,Year等 - */ - @SerializedName("ChargeType") - private String chargeType; - /** - * 资源创建时间戳 - */ - @SerializedName("CreateTime") - private Integer createTime; - /** - * 资源过期时间戳 - */ - @SerializedName("ExpireTime") - private Integer expireTime; - - @SerializedName("OutPublicIpList") - private List outPublicIpInfos; - - public List getOutPublicIpInfos() { - return outPublicIpInfos; - } - - public void setOutPublicIpInfos(List outPublicIpInfos) { - this.outPublicIpInfos = outPublicIpInfos; - } - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getAcceleratingDomain() { - return this.acceleratingDomain; - } - - public void setAcceleratingDomain(String acceleratingDomain) { - this.acceleratingDomain = acceleratingDomain; - } - - public String getArea() { - return this.area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getTargetIP() { - return this.targetIP; - } - - public void setTargetIP(String targetIP) { - this.targetIP = targetIP; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public Integer getPort() { - return this.port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public String getChargeType() { - return this.chargeType; - } - - public void setChargeType(String chargeType) { - this.chargeType = chargeType; - } - - public Integer getCreateTime() { - return this.createTime; - } - - public void setCreateTime(Integer createTime) { - this.createTime = createTime; - } - - public Integer getExpireTime() { - return this.expireTime; - } - - public void setExpireTime(Integer expireTime) { - this.expireTime = expireTime; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHMetric.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHMetric.java deleted file mode 100644 index f063ea02..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/GlobalSSHMetric.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : GlobalSSH一段时间内的带宽监控数据 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class GlobalSSHMetric { - /** - * 出向带宽 - */ - @SerializedName("NetworkOut") - private List networkOut; - /** - * 入向带宽 - */ - @SerializedName("NetworkIn") - private List networkIn; - - - public List getNetworkOut() { - return this.networkOut; - } - - public void setNetworkOut(List networkOut) { - this.networkOut = networkOut; - } - - - public List getNetworkIn() { - return this.networkIn; - } - - public void setNetworkIn(List networkIn) { - this.networkIn = networkIn; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistParam.java deleted file mode 100644 index 69839ac7..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistParam.java +++ /dev/null @@ -1,93 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.validation.ValidationException; -import javax.validation.constraints.NotEmpty; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 增量插入白名单 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class InsertPathXWhitelistParam extends BaseRequestParam { - /** - * 实例ID,资源唯一标识 - */ - @UcloudParam("InstanceId") - @NotEmpty(message = "instanceId can not be empty") - private String instanceId; - - /** - * 白名单规则,例如 'Whitelist.0: 192.168.1.1/24|tcp|22', - * 'Whitelist.1: 192.168.1.2|tcp|8080:8090', - * 第一个参数为ip或ip段,第二个参数代表协议(tcp/udp), - * 第三个参数代表端口号或端口范围(使用 ':' 隔开); - * 可以添加多条规则(递增Rule.n字段内的n值); - * 此接口用于在原有规则基础上增量添加新的规则 - */ - private List whiteList; - - - public InsertPathXWhitelistParam(String projectId - , String instanceId - , List whiteList - ) { - super("InsertPathXWhitelist"); - this.projectId = projectId; - this.instanceId = instanceId; - this.whiteList = whiteList; - } - - - @UcloudParam("WhiteList") - public List checkWhitelist() throws ValidationException { - List params = new ArrayList<>(); - if (whiteList == null || whiteList.isEmpty()) { - throw new ValidationException("whiteList can not be empty"); - } - int size = whiteList.size(); - for (int i = 0; i < size; i++) { - PathXWhitelist wl = whiteList.get(i); - if (wl == null) { - throw new ValidationException(String.format("whiteList[%d] can not be empty", i)); - } - if (wl.getIp() == null || wl.getIp().length() <= 0) { - throw new ValidationException(String.format("whiteList[%d].ip can not be empty", i)); - } - if (wl.getProtocol() == null || wl.getProtocol().length() <= 0) { - throw new ValidationException(String.format("whiteList[%d].protocol can not be empty", i)); - } - if (wl.getPort() == null || wl.getPort().length() <= 0) { - throw new ValidationException(String.format("whiteList[%d].port can not be empty", i)); - } - params.add(new Param(String.format("Whitelist.%d", i), - String.format("%s|%s|%s", wl.getIp(), wl.getProtocol(), wl.getPort()))); - } - return params; - } - - - public List getWhiteList() { - return whiteList; - } - - public void setWhiteList(List whiteList) { - this.whiteList = whiteList; - } - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistResult.java deleted file mode 100644 index 1bae035f..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InsertPathXWhitelistResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 增量插入白名单 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class InsertPathXWhitelistResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InstanceWhitelist.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InstanceWhitelist.java deleted file mode 100644 index 4f017686..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/InstanceWhitelist.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 实例白名单规则 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class InstanceWhitelist { - /** - * 实例ID - */ - @SerializedName("InstanceId") - private String instanceId; - /** - * 白名单规则列表 - */ - @SerializedName("RuleSet") - private List ruleSet; - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - - public List getRuleSet() { - return this.ruleSet; - } - - public void setRuleSet(List ruleSet) { - this.ruleSet = ruleSet; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/LineDetail.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/LineDetail.java deleted file mode 100644 index 3223cc50..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/LineDetail.java +++ /dev/null @@ -1,80 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 子线路 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class LineDetail { - /** - * 线路源 - */ - @SerializedName("LineFrom") - private String lineFrom; - /** - * 线路目的 - */ - @SerializedName("LineTo") - private String lineTo; - /** - * 线路计费Id - */ - @SerializedName("LineId") - private String lineId; - /** - * 线路源中文名称 - */ - @SerializedName("LineFromName") - private String lineFromName; - /** - * 线路目的中文名称 - */ - @SerializedName("LineToName") - private String lineToName; - - - public String getLineFrom() { - return this.lineFrom; - } - - public void setLineFrom(String lineFrom) { - this.lineFrom = lineFrom; - } - - public String getLineTo() { - return this.lineTo; - } - - public void setLineTo(String lineTo) { - this.lineTo = lineTo; - } - - public String getLineId() { - return this.lineId; - } - - public void setLineId(String lineId) { - this.lineId = lineId; - } - - public String getLineFromName() { - return this.lineFromName; - } - - public void setLineFromName(String lineFromName) { - this.lineFromName = lineFromName; - } - - public String getLineToName() { - return this.lineToName; - } - - public void setLineToName(String lineToName) { - this.lineToName = lineToName; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MatricPoint.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MatricPoint.java deleted file mode 100644 index ea31d9a4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MatricPoint.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - - -/** - * @Description : 某一时刻的监控数据 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class MatricPoint { - /** - * - */ - @SerializedName("Timestamp") - private Integer timestamp; - /** - * - */ - @SerializedName("Value") - private Integer value; - - - public Integer getTimestamp() { - return this.timestamp; - } - - public void setTimestamp(Integer timestamp) { - this.timestamp = timestamp; - } - - public Integer getValue() { - return this.value; - } - - public void setValue(Integer value) { - this.value = value; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MetricPeriod.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MetricPeriod.java deleted file mode 100644 index b84d8447..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/MetricPeriod.java +++ /dev/null @@ -1,143 +0,0 @@ -package cn.ucloud.pathx.model; - -import com.google.gson.annotations.SerializedName; - -import java.util.List; - - -/** - * @Description : 一段时间内的监控数据 模型类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class MetricPeriod { - /** - * 出口带宽 - */ - @SerializedName("NetworkOut") - private List networkOut; - /** - * 入口带宽 - */ - @SerializedName("NetworkIn") - private List networkIn; - /** - * 出口使用率 - */ - @SerializedName("NetworkOutUsage") - private List networkOutUsage; - /** - * 入口使用率 - */ - @SerializedName("NetworkInUsage") - private List networkInUsage; - /** - * - */ - @SerializedName("BandIn") - private List bandIn; - /** - * - */ - @SerializedName("BandOut") - private List bandOut; - - @SerializedName("TCPDelay") - private Double tcpDelay; - - @SerializedName("InputRetransmitRate") - private Double inputRetransmitRate; - - @SerializedName("OutputRetransmitRate") - private Double outputRetransmitRate; - - @SerializedName("TCPConNum") - private Integer tcpConNum; - - public Double getTcpDelay() { - return tcpDelay; - } - - public void setTcpDelay(Double tcpDelay) { - this.tcpDelay = tcpDelay; - } - - public Double getInputRetransmitRate() { - return inputRetransmitRate; - } - - public void setInputRetransmitRate(Double inputRetransmitRate) { - this.inputRetransmitRate = inputRetransmitRate; - } - - public Double getOutputRetransmitRate() { - return outputRetransmitRate; - } - - public void setOutputRetransmitRate(Double outputRetransmitRate) { - this.outputRetransmitRate = outputRetransmitRate; - } - - public Integer getTcpConNum() { - return tcpConNum; - } - - public void setTcpConNum(Integer tcpConNum) { - this.tcpConNum = tcpConNum; - } - - public List getNetworkOut() { - return this.networkOut; - } - - public void setNetworkOut(List networkOut) { - this.networkOut = networkOut; - } - - - public List getNetworkIn() { - return this.networkIn; - } - - public void setNetworkIn(List networkIn) { - this.networkIn = networkIn; - } - - - public List getNetworkOutUsage() { - return this.networkOutUsage; - } - - public void setNetworkOutUsage(List networkOutUsage) { - this.networkOutUsage = networkOutUsage; - } - - - public List getNetworkInUsage() { - return this.networkInUsage; - } - - public void setNetworkInUsage(List networkInUsage) { - this.networkInUsage = networkInUsage; - } - - - public List getBandIn() { - return this.bandIn; - } - - public void setBandIn(List bandIn) { - this.bandIn = bandIn; - } - - - public List getBandOut() { - return this.bandOut; - } - - public void setBandOut(List bandOut) { - this.bandOut = bandOut; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortParam.java deleted file mode 100644 index 190497f4..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortParam.java +++ /dev/null @@ -1,58 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 修改GlobalSSH端口 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyGlobalSSHPortParam extends BaseRequestParam { - /** - * 实例ID,资源唯一标识 - */ - @UcloudParam("InstanceId") - @NotEmpty(message = "instanceId can not be empty") - private String instanceId; - /** - * 调整后的SSH登陆端口 - */ - @UcloudParam("Port") - @NotNull(message = "port can not be null") - private Integer port; - - - public ModifyGlobalSSHPortParam(String projectId - , String instanceId - , Integer port - ) { - super("ModifyGlobalSSHPort"); - this.projectId = projectId; - this.instanceId = instanceId; - this.port = port; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public Integer getPort() { - return this.port; - } - - public void setPort(Integer port) { - this.port = port; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortResult.java deleted file mode 100644 index 0bf8208b..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHPortResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 修改GlobalSSH端口 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyGlobalSSHPortResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkParam.java deleted file mode 100644 index 110f5d5d..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkParam.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 修改GlobalSSH备注 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyGlobalSSHRemarkParam extends BaseRequestParam { - /** - * 实例ID,资源唯一标识 - */ - @UcloudParam("InstanceId") - @NotEmpty(message = "instanceId can not be empty") - private String instanceId; - /** - * 备注信息,不填默认为空字符串 - */ - @UcloudParam("Remark") - private String remark; - - - public ModifyGlobalSSHRemarkParam(String projectId - , String instanceId - ) { - super("ModifyGlobalSSHRemark"); - this.projectId = projectId; - this.instanceId = instanceId; - } - - - public String getInstanceId() { - return this.instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getRemark() { - return this.remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkResult.java deleted file mode 100644 index 4e7c3d7d..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyGlobalSSHRemarkResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 修改GlobalSSH备注 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyGlobalSSHRemarkResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthParam.java deleted file mode 100644 index 530280bb..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - - -/** - * @Description : 修改加速线路带宽 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyUPathBandwidthParam extends BaseRequestParam { - /** - * 加速线路Id - */ - @UcloudParam("UPathId") - @NotEmpty(message = "uPathId can not be empty") - private String uPathId; - /** - * 带宽 - */ - @UcloudParam("Bandwidth") - @NotNull(message = "bandwidth can not be null") - private Integer bandwidth; - - - public ModifyUPathBandwidthParam(String projectId - , String uPathId - , Integer bandwidth - ) { - super("ModifyUPathBandwidth"); - this.projectId = projectId; - this.uPathId = uPathId; - this.bandwidth = bandwidth; - } - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - public Integer getBandwidth() { - return bandwidth; - } - - public void setBandwidth(Integer bandwidth) { - this.bandwidth = bandwidth; - } -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthResult.java deleted file mode 100644 index 7dab7ec3..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathBandwidthResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 修改加速线路带宽 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyUPathBandwidthResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameParam.java deleted file mode 100644 index dffd3a5e..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; - -import javax.validation.constraints.NotEmpty; - - -/** - * @Description : 更改加速线路名字 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyUPathNameParam extends BaseRequestParam { - /** - * UPath ID - */ - @UcloudParam("UPathId") - @NotEmpty(message = "uPathId can not be empty") - private String uPathId; - /** - * 名字 - */ - @UcloudParam("Name") - @NotEmpty(message = "name can not be empty") - private String name; - - - public ModifyUPathNameParam(String projectId - , String uPathId - , String name - ) { - super("ModifyUPathName"); - this.projectId = projectId; - this.uPathId = uPathId; - this.name = name; - } - - - public String getuPathId() { - return this.uPathId; - } - - public void setuPathId(String uPathId) { - this.uPathId = uPathId; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameResult.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameResult.java deleted file mode 100644 index b7e30d40..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathNameResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.pojo.BaseResponseResult; - - -/** - * @Description : 更改加速线路名字 结果类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyUPathNameResult extends BaseResponseResult { - - -} \ No newline at end of file diff --git a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathTemplateParam.java b/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathTemplateParam.java deleted file mode 100644 index 225f3485..00000000 --- a/ucloud-sdk-java-pathx/src/main/java/cn/ucloud/pathx/model/ModifyUPathTemplateParam.java +++ /dev/null @@ -1,213 +0,0 @@ -package cn.ucloud.pathx.model; - -import cn.ucloud.common.annotation.UcloudParam; -import cn.ucloud.common.pojo.BaseRequestParam; -import cn.ucloud.common.pojo.Param; - -import javax.xml.bind.ValidationException; -import java.util.ArrayList; -import java.util.List; - - -/** - * @Description : 修改UPath监控告警项 参数类 - * @Author : ucloud-sdk-generator - * @Date : 2019-03-13 10:02 - **/ -public class ModifyUPathTemplateParam extends BaseRequestParam { - - public static class Template { - - /** - * 指标名称 - */ - private String metricName; - - /** - * 告警阈值 - */ - private Integer threshold; - - /** - * 连续告警间隔,单位:分钟 (5,10,15,525600) - */ - private Integer alarmFrequency; - - /** - * 告警组id - */ - private Integer contactGroupId; - - /** - * 比较方式[‘GE’,’LE’] - */ - private String compare; - - /** - * 收敛策略 - */ - private String alarmStrategy; - - /** - * 连续触发次数 - */ - private Integer triggerCount; - - public Template(String metricName, - Integer threshold, - Integer alarmFrequency, - Integer contactGroupId, - String compare, - String alarmStrategy, - Integer triggerCount) { - this.metricName = metricName; - this.threshold = threshold; - this.alarmFrequency = alarmFrequency; - this.contactGroupId = contactGroupId; - this.compare = compare; - this.alarmStrategy = alarmStrategy; - this.triggerCount = triggerCount; - } - - public String getMetricName() { - return metricName; - } - - public void setMetricName(String metricName) { - this.metricName = metricName; - } - - public Integer getThreshold() { - return threshold; - } - - public void setThreshold(Integer threshold) { - this.threshold = threshold; - } - - public Integer getAlarmFrequency() { - return alarmFrequency; - } - - public void setAlarmFrequency(Integer alarmFrequency) { - this.alarmFrequency = alarmFrequency; - } - - public Integer getContactGroupId() { - return contactGroupId; - } - - public void setContactGroupId(Integer contactGroupId) { - this.contactGroupId = contactGroupId; - } - - public String getCompare() { - return compare; - } - - public void setCompare(String compare) { - this.compare = compare; - } - - public String getAlarmStrategy() { - return alarmStrategy; - } - - public void setAlarmStrategy(String alarmStrategy) { - this.alarmStrategy = alarmStrategy; - } - - public Integer getTriggerCount() { - return triggerCount; - } - - public void setTriggerCount(Integer triggerCount) { - this.triggerCount = triggerCount; - } - } - - /** - * 线路ID - */ - @UcloudParam("UPathID") - private String uPathID; - - private List