Skip to content

Commit bed8421

Browse files
committed
release 0.0.5-beta source code for php
1 parent 44cba14 commit bed8421

21 files changed

+2341
-18
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# 0.0.5-beta 2023-05-12
2+
3+
### G42Cloud SDK ECS
4+
5+
- _Features_
6+
- Support the interface `NovaAttachInterface`
7+
- _Bug Fix_
8+
- None
9+
- _Change_
10+
- None
11+
12+
### G42Cloud SDK IMS
13+
14+
- _Features_
15+
- None
16+
- _Bug Fix_
17+
- None
18+
- _Change_
19+
- **ListImages**
20+
- changes of request param
21+
- `+ __imagetype: enum value [market]`
22+
123
# 0.0.4-beta 2023-04-14
224

325
### G42Cloud SDK Core

Core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"api",
99
"core"
1010
],
11-
"version": "0.0.4-beta",
11+
"version": "0.0.5-beta",
1212
"type": "library",
1313
"license": "Apache-2.0",
1414
"authors": [

Core/src/Auth/Signer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ private function CanonicalQueryString($r)
115115
array_push($a, $kv);
116116
}
117117
} else {
118-
$kv = "$k=".str_replace(['+', '%7E'], ['%20',
119-
'~', ], urlencode($value));
118+
if (!is_string($value)) {
119+
$value = json_encode($value);
120+
}
121+
$kv = "$k=" . str_replace(['+', '%7E'], ['%20',
122+
'~',], urlencode($value));
120123
array_push($a, $kv);
121124
}
122125
}

Services/Cdn/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"api",
99
"cdn"
1010
],
11-
"version": "0.0.4-beta",
11+
"version": "0.0.5-beta",
1212
"type": "library",
1313
"license": "Apache-2.0",
1414
"authors": [
@@ -20,7 +20,7 @@
2020
],
2121
"minimum-stability": "dev",
2222
"require": {
23-
"g42cloud/cloud-sdk-core": "0.0.4-beta"
23+
"g42cloud/cloud-sdk-core": "0.0.5-beta"
2424
},
2525
"autoload": {
2626
"psr-4": {

Services/Cse/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"api",
99
"cse"
1010
],
11-
"version": "0.0.4-beta",
11+
"version": "0.0.5-beta",
1212
"type": "library",
1313
"license": "Apache-2.0",
1414
"authors": [
@@ -20,7 +20,7 @@
2020
],
2121
"minimum-stability": "dev",
2222
"require": {
23-
"g42cloud/cloud-sdk-core": "0.0.4-beta"
23+
"g42cloud/cloud-sdk-core": "0.0.5-beta"
2424
},
2525
"autoload": {
2626
"psr-4": {

Services/Ecs/V2/EcsAsyncClient.php

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,6 +2401,74 @@ public function novaAssociateSecurityGroupAsyncWithHttpInfo($request){
24012401
$asyncRequest = true);
24022402
}
24032403

2404+
/**
2405+
* 添加云服务器网卡
2406+
*
2407+
* 给云服务器添加一张网卡。
2408+
*
2409+
* Please refer to G42 cloud API Explorer for details.
2410+
*
2411+
* @param $request 请求对象
2412+
* @return response
2413+
*/
2414+
public function novaAttachInterfaceAsync($request)
2415+
{
2416+
return $this->novaAttachInterfaceAsyncWithHttpInfo($request);
2417+
}
2418+
2419+
public function novaAttachInterfaceAsyncWithHttpInfo($request){
2420+
$collection_formats = [];
2421+
$resourcePath = '/v2.1/{project_id}/servers/{server_id}/os-interface';
2422+
$formParams = [];
2423+
$queryParams = [];
2424+
$headerParams = [];
2425+
$pathParams = [];
2426+
$httpBody = null;
2427+
$multipart = false;
2428+
$localVarParams = [];
2429+
$arr = $request::attributeMap();
2430+
foreach ($arr as $k => $v) {
2431+
$getter = $request::getters()[$k];
2432+
$value = $request->$getter();
2433+
$localVarParams[$k] = $value;
2434+
}
2435+
if ($localVarParams['serverId'] !== null) {
2436+
$pathParams['server_id'] = $localVarParams['serverId'];
2437+
}
2438+
if ($localVarParams['body'] !== null) {
2439+
$httpBody= $localVarParams['body'];
2440+
}
2441+
2442+
if ($multipart) {
2443+
$headers = $this->headerSelector->selectHeadersForMultipart(
2444+
['*/*', 'application/json']
2445+
);
2446+
} else {
2447+
$headers = $this->headerSelector->selectHeaders(
2448+
['*/*', 'application/json'],
2449+
['application/json;charset=UTF-8']
2450+
);
2451+
}
2452+
$headers = array_merge(
2453+
$headerParams,
2454+
$headers
2455+
);
2456+
2457+
return $this->callApi(
2458+
$method='POST',
2459+
$resourcePath,
2460+
$pathParams,
2461+
$queryParams,
2462+
$headerParams=$headers,
2463+
$body=$httpBody,
2464+
$multipart = $multipart,
2465+
$postParams=$formParams,
2466+
$responseType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceResponse',
2467+
$collectionFormats=$collection_formats,
2468+
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceRequest',
2469+
$asyncRequest = true);
2470+
}
2471+
24042472
/**
24052473
* 创建和导入SSH密钥
24062474
*

Services/Ecs/V2/EcsClient.php

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,71 @@ public function novaAssociateSecurityGroupWithHttpInfo($request)
23002300
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAssociateSecurityGroupRequest');
23012301
}
23022302

2303+
/**
2304+
* 添加云服务器网卡
2305+
*
2306+
* 给云服务器添加一张网卡。
2307+
*
2308+
* Please refer to G42 cloud API Explorer for details.
2309+
*
2310+
* @param $request 请求对象
2311+
* @return response
2312+
*/
2313+
public function novaAttachInterface($request)
2314+
{
2315+
return $this->novaAttachInterfaceWithHttpInfo($request);
2316+
}
2317+
2318+
public function novaAttachInterfaceWithHttpInfo($request)
2319+
{
2320+
$resourcePath = '/v2.1/{project_id}/servers/{server_id}/os-interface';
2321+
$formParams = [];
2322+
$queryParams = [];
2323+
$headerParams = [];
2324+
$pathParams = [];
2325+
$httpBody = null;
2326+
$multipart = false;
2327+
$localVarParams = [];
2328+
$arr = $request::attributeMap();
2329+
foreach ($arr as $k => $v) {
2330+
$getter = $request::getters()[$k];
2331+
$value = $request->$getter();
2332+
$localVarParams[$k] = $value;
2333+
}
2334+
if ($localVarParams['serverId'] !== null) {
2335+
$pathParams['server_id'] = $localVarParams['serverId'];
2336+
}
2337+
if ($localVarParams['body'] !== null) {
2338+
$httpBody= $localVarParams['body'];
2339+
}
2340+
if ($multipart) {
2341+
$headers = $this->headerSelector->selectHeadersForMultipart(
2342+
['*/*', 'application/json']
2343+
);
2344+
} else {
2345+
$headers = $this->headerSelector->selectHeaders(
2346+
['*/*', 'application/json'],
2347+
['application/json;charset=UTF-8']
2348+
);
2349+
}
2350+
$headers = array_merge(
2351+
$headerParams,
2352+
$headers
2353+
);
2354+
2355+
return $this->callApi(
2356+
$method='POST',
2357+
$resourcePath,
2358+
$pathParams,
2359+
$queryParams,
2360+
$headerParams=$headers,
2361+
$body=$httpBody,
2362+
$multipart = $multipart,
2363+
$postParams=$formParams,
2364+
$responseType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceResponse',
2365+
$requestType='\G42Cloud\SDK\Ecs\V2\Model\NovaAttachInterfaceRequest');
2366+
}
2367+
23032368
/**
23042369
* 创建和导入SSH密钥
23052370
*

0 commit comments

Comments
 (0)