Skip to content

Commit

Permalink
release 0.0.5-beta source code for php
Browse files Browse the repository at this point in the history
  • Loading branch information
unionsdk committed May 12, 2023
1 parent 44cba14 commit bed8421
Show file tree
Hide file tree
Showing 21 changed files with 2,341 additions and 18 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 0.0.5-beta 2023-05-12

### G42Cloud SDK ECS

- _Features_
- Support the interface `NovaAttachInterface`
- _Bug Fix_
- None
- _Change_
- None

### G42Cloud SDK IMS

- _Features_
- None
- _Bug Fix_
- None
- _Change_
- **ListImages**
- changes of request param
- `+ __imagetype: enum value [market]`

# 0.0.4-beta 2023-04-14

### G42Cloud SDK Core
Expand Down
2 changes: 1 addition & 1 deletion Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"api",
"core"
],
"version": "0.0.4-beta",
"version": "0.0.5-beta",
"type": "library",
"license": "Apache-2.0",
"authors": [
Expand Down
7 changes: 5 additions & 2 deletions Core/src/Auth/Signer.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ private function CanonicalQueryString($r)
array_push($a, $kv);
}
} else {
$kv = "$k=".str_replace(['+', '%7E'], ['%20',
'~', ], urlencode($value));
if (!is_string($value)) {
$value = json_encode($value);
}
$kv = "$k=" . str_replace(['+', '%7E'], ['%20',
'~',], urlencode($value));
array_push($a, $kv);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Services/Cdn/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"api",
"cdn"
],
"version": "0.0.4-beta",
"version": "0.0.5-beta",
"type": "library",
"license": "Apache-2.0",
"authors": [
Expand All @@ -20,7 +20,7 @@
],
"minimum-stability": "dev",
"require": {
"g42cloud/cloud-sdk-core": "0.0.4-beta"
"g42cloud/cloud-sdk-core": "0.0.5-beta"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions Services/Cse/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"api",
"cse"
],
"version": "0.0.4-beta",
"version": "0.0.5-beta",
"type": "library",
"license": "Apache-2.0",
"authors": [
Expand All @@ -20,7 +20,7 @@
],
"minimum-stability": "dev",
"require": {
"g42cloud/cloud-sdk-core": "0.0.4-beta"
"g42cloud/cloud-sdk-core": "0.0.5-beta"
},
"autoload": {
"psr-4": {
Expand Down
68 changes: 68 additions & 0 deletions Services/Ecs/V2/EcsAsyncClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,74 @@ public function novaAssociateSecurityGroupAsyncWithHttpInfo($request){
$asyncRequest = true);
}

/**
* 添加云服务器网卡
*
* 给云服务器添加一张网卡。
*
* Please refer to G42 cloud API Explorer for details.
*
* @param $request 请求对象
* @return response
*/
public function novaAttachInterfaceAsync($request)
{
return $this->novaAttachInterfaceAsyncWithHttpInfo($request);
}

public function novaAttachInterfaceAsyncWithHttpInfo($request){
$collection_formats = [];
$resourcePath = '/v2.1/{project_id}/servers/{server_id}/os-interface';
$formParams = [];
$queryParams = [];
$headerParams = [];
$pathParams = [];
$httpBody = null;
$multipart = false;
$localVarParams = [];
$arr = $request::attributeMap();
foreach ($arr as $k => $v) {
$getter = $request::getters()[$k];
$value = $request->$getter();
$localVarParams[$k] = $value;
}
if ($localVarParams['serverId'] !== null) {
$pathParams['server_id'] = $localVarParams['serverId'];
}
if ($localVarParams['body'] !== null) {
$httpBody= $localVarParams['body'];
}

if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['*/*', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['*/*', 'application/json'],
['application/json;charset=UTF-8']
);
}
$headers = array_merge(
$headerParams,
$headers
);

return $this->callApi(
$method='POST',
$resourcePath,
$pathParams,
$queryParams,
$headerParams=$headers,
$body=$httpBody,
$multipart = $multipart,
$postParams=$formParams,
$responseType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceResponse',
$collectionFormats=$collection_formats,
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceRequest',
$asyncRequest = true);
}

/**
* 创建和导入SSH密钥
*
Expand Down
65 changes: 65 additions & 0 deletions Services/Ecs/V2/EcsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,71 @@ public function novaAssociateSecurityGroupWithHttpInfo($request)
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAssociateSecurityGroupRequest');
}

/**
* 添加云服务器网卡
*
* 给云服务器添加一张网卡。
*
* Please refer to G42 cloud API Explorer for details.
*
* @param $request 请求对象
* @return response
*/
public function novaAttachInterface($request)
{
return $this->novaAttachInterfaceWithHttpInfo($request);
}

public function novaAttachInterfaceWithHttpInfo($request)
{
$resourcePath = '/v2.1/{project_id}/servers/{server_id}/os-interface';
$formParams = [];
$queryParams = [];
$headerParams = [];
$pathParams = [];
$httpBody = null;
$multipart = false;
$localVarParams = [];
$arr = $request::attributeMap();
foreach ($arr as $k => $v) {
$getter = $request::getters()[$k];
$value = $request->$getter();
$localVarParams[$k] = $value;
}
if ($localVarParams['serverId'] !== null) {
$pathParams['server_id'] = $localVarParams['serverId'];
}
if ($localVarParams['body'] !== null) {
$httpBody= $localVarParams['body'];
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['*/*', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['*/*', 'application/json'],
['application/json;charset=UTF-8']
);
}
$headers = array_merge(
$headerParams,
$headers
);

return $this->callApi(
$method='POST',
$resourcePath,
$pathParams,
$queryParams,
$headerParams=$headers,
$body=$httpBody,
$multipart = $multipart,
$postParams=$formParams,
$responseType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceResponse',
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceRequest');
}

/**
* 创建和导入SSH密钥
*
Expand Down
Loading

0 comments on commit bed8421

Please sign in to comment.