Skip to content

Commit f9e2a63

Browse files
committed
release 0.0.7-beta source code for net
1 parent d32e11b commit f9e2a63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1829
-266
lines changed

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
# 0.0.7-beta 2023-06-16
2+
3+
### G42Cloud SDK CCE
4+
5+
- _Features_
6+
- None
7+
- _Bug Fix_
8+
- None
9+
- _Change_
10+
- **ShowNode**
11+
- changes of response param
12+
- `+ status.lastProbeTime`
13+
- **UpdateNode**
14+
- changes of response param
15+
- `+ status.lastProbeTime`
16+
- **DeleteNode**
17+
- changes of response param
18+
- `+ status.lastProbeTime`
19+
- **CreateNode**
20+
- changes of response param
21+
- `+ status.lastProbeTime`
22+
- **ListNodes**
23+
- changes of response param
24+
- `+ items.status.lastProbeTime`
25+
26+
### G42Cloud SDK ECS
27+
28+
- _Features_
29+
- None
30+
- _Bug Fix_
31+
- None
32+
- _Change_
33+
- **CreateServers**
34+
- changes of request param
35+
- `+ server.data_volumes.delete_on_termination`
36+
- **CreatePostPaidServers**
37+
- changes of request param
38+
- `+ server.data_volumes.delete_on_termination`
39+
40+
### G42Cloud SDK SMN
41+
42+
- _Features_
43+
- Support the following interfaces:
44+
- `UpdateSubscription`
45+
- `ListLogtank`
46+
- `CreateLogtank`
47+
- `UpdateLogtank`
48+
- `DeleteLogtank`
49+
- _Bug Fix_
50+
- None
51+
- _Change_
52+
- **ListTopicDetails**
53+
- changes of response param
54+
- `+ topic_id`
55+
- **ListTopics**
56+
- changes of request param
57+
- `+ topic_id`
58+
- changes of response param
59+
- `+ topics.topic_id`
60+
- **ListTopicAttributes**
61+
- changes of response param
62+
- `+ attributes.access_policy`
63+
- `+ attributes.introduction`
64+
- `- attributes.Version`
65+
- `- attributes.Id`
66+
- `- attributes.Statement`
67+
- **AddSubscription**
68+
- changes of request param
69+
- `+ extension`
70+
171
# 0.0.6-beta 2023-05-12
272

373
### G42Cloud SDK CBR

Core/Http/HttpConfig.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ public class HttpConfig
2525
{
2626
public int? Timeout = 120;
2727

28-
public bool IgnoreSslVerification = false;
28+
public bool IgnoreSslVerification;
2929

30-
public bool IgnoreBodyForGetRequest = false;
30+
public bool IgnoreBodyForGetRequest;
31+
32+
/// <summary>
33+
/// Experimental configuration, the default value is false.
34+
/// Automatic redirection is allowed when turns on, which may cause some request exceptions.
35+
/// </summary>
36+
public bool AllowRedirects;
3137

3238
public string ProxyUsername { get; set; }
3339

@@ -62,6 +68,16 @@ public HttpConfig WithIgnoreBodyForGetRequest(bool ignore)
6268
return this;
6369
}
6470

71+
/// <summary>
72+
/// Experimental configuration, the default value is false.
73+
/// Automatic redirection is allowed when turns on, which may cause some request exceptions.
74+
/// </summary>
75+
public HttpConfig WithAllowRedirects(bool allowRedirects)
76+
{
77+
this.AllowRedirects = allowRedirects;
78+
return this;
79+
}
80+
6581
public HttpConfig WithIgnoreProxyUsername(string username)
6682
{
6783
this.ProxyUsername = username;
@@ -92,4 +108,4 @@ public HttpConfig WithProxyPort(int port)
92108
return this;
93109
}
94110
}
95-
}
111+
}

Core/Http/SdkHttpClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
using System.Threading.Tasks;
3030
using Microsoft.Extensions.DependencyInjection;
3131
using Microsoft.Extensions.Logging;
32-
using Polly;
3332

3433
namespace G42Cloud.SDK.Core
3534
{

Core/Http/SdkHttpMessageHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public DelegatingHandler GetHandler()
4040
{
4141
var handler = new HttpClientHandler
4242
{
43+
AllowAutoRedirect = _httpConfig.AllowRedirects,
4344
ClientCertificateOptions = ClientCertificateOption.Manual,
4445
ServerCertificateCustomValidationCallback =
4546
(httpRequestMessage, cert, cetChain, policyErrors) =>

Core/Utils/HttpUtils.cs

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,30 @@ namespace G42Cloud.SDK.Core
3131
{
3232
public static class HttpUtils
3333
{
34+
35+
private static readonly List<string> HttpContentHeadersList = new List<string>
36+
{
37+
"Allow",
38+
"Content-Disposition",
39+
"Content-Encoding",
40+
"Content-Language",
41+
"Content-Location",
42+
"Content-MD5",
43+
"Content-Range",
44+
"Content-Type",
45+
"Content-Length",
46+
"Expires",
47+
"Last-Modified"
48+
};
49+
3450
public static string AddUrlPath(string path, Dictionary<string, string> pathParams)
3551
{
3652
return pathParams.Aggregate(path,
3753
(current, keyValuePair) => current.Replace("{" + keyValuePair.Key + "}",
3854
keyValuePair.Value));
3955
}
4056

41-
private static string GetQueryParameters(Object obj)
57+
private static string GetQueryParameters(object obj)
4258
{
4359
var sb = new StringBuilder();
4460
var t = obj.GetType();
@@ -270,13 +286,18 @@ private static string GetRequestBody(object obj, string contentType)
270286
{
271287
foreach (var elem in sdkPropertyList)
272288
{
289+
if (elem is string eleString)
290+
{
291+
return eleString;
292+
}
293+
273294
return contentType == "application/xml" ? XmlUtils.Serialize(elem) : JsonUtils.Serialize(elem);
274295
}
275296
}
276297

277298
return "";
278299
}
279-
300+
280301
private static Dictionary<string, object> GetFormData(object obj)
281302
{
282303
var t = obj.GetType();
@@ -328,14 +349,14 @@ private static Dictionary<string, object> GetFormData(object obj)
328349
}
329350

330351
return null;
331-
}
352+
}
332353

333354
public static SdkRequest InitSdkRequest(string path, object data = null)
334355
{
335356
return InitSdkRequest(path, null, data);
336357
}
337358

338-
public static SdkRequest InitSdkRequest(string path, String contentType, object data = null)
359+
public static SdkRequest InitSdkRequest(string path, string contentType, object data = null)
339360
{
340361
if (path != null && string.IsNullOrEmpty(path))
341362
{
@@ -352,7 +373,7 @@ public static SdkRequest InitSdkRequest(string path, String contentType, object
352373
}
353374

354375
var cname = GetCname(data);
355-
if (!String.IsNullOrEmpty(cname))
376+
if (!string.IsNullOrEmpty(cname))
356377
{
357378
request.Cname = cname;
358379
}
@@ -385,7 +406,7 @@ public static SdkRequest InitSdkRequest(string path, String contentType, object
385406
request.Body = bodyData;
386407
}
387408
}
388-
409+
389410
if (!string.IsNullOrEmpty(contentType))
390411
{
391412
request.ContentType = contentType;
@@ -405,7 +426,7 @@ public static T DeSerializeStream<T>(HttpResponseMessage message)
405426
var t = Activator.CreateInstance<T>();
406427
t.GetType().GetProperty("HttpStatusCode")?.SetValue(t, (int)message.StatusCode, null);
407428
t.GetType().GetProperty("HttpHeaders")?.SetValue(t, message.Headers.ToString(), null);
408-
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance;
429+
var flag = BindingFlags.Public | BindingFlags.Instance;
409430
t.GetType().GetMethod("SetStream")
410431
?.Invoke(t, flag, Type.DefaultBinder,
411432
new object[]
@@ -422,21 +443,6 @@ public static void SetAdditionalAttrs<T>(HttpResponseMessage message, T obj, str
422443
obj.GetType().GetProperty("HttpBody")?.SetValue(obj, body, null);
423444
}
424445

425-
private static readonly List<string> HttpContentHeadersList = new List<string>
426-
{
427-
"Allow",
428-
"Content-Disposition",
429-
"Content-Encoding",
430-
"Content-Language",
431-
"Content-Location",
432-
"Content-MD5",
433-
"Content-Range",
434-
"Content-Type",
435-
"Content-Length",
436-
"Expires",
437-
"Last-Modified"
438-
};
439-
440446
public static void SetResponseHeaders<T>(HttpResponseMessage message, T obj)
441447
{
442448
const BindingFlags instanceBindFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;

Core/Utils/JsonUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static List<T> DeSerializeList<T>(HttpResponseMessage message)
8787
public static Dictionary<TK, TV> DeSerializeMap<TK, TV>(HttpResponseMessage message)
8888
{
8989
var body = Encoding.UTF8.GetString(message.Content.ReadAsByteArrayAsync().Result);
90-
return JArray.Parse(body).ToObject<Dictionary<TK, TV>>(JsonSerializer.CreateDefault(GetJsonSettings()));
90+
return JObject.Parse(body).ToObject<Dictionary<TK, TV>>(JsonSerializer.CreateDefault(GetJsonSettings()));
9191
}
9292

9393
public static string Serialize(object item)

Core/obj/Core.csproj.nuget.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"version": 1,
3-
"dgSpecHash": "/uxPzudilK7z2cmcr8LmLAMNuQ3d4mkPcnRYFwycy3PGe6bg0rL/aXKhMoaCKTAGOwJqw+661uZhyMwQHaDr9w==",
3+
"dgSpecHash": "S5xIaIcGMIsBBCvQrx7vip2flFB4b0F9mOEKJ2ghOj/Uyi8yJyb0CBjWxVH/oIOL7gvCo7AP+srJgUB1oMr2lg==",
44
"success": true
55
}

Core/obj/Core.csproj.nuget.dgspec.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"format": 1,
33
"restore": {
4-
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj": {}
4+
"/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj": {}
55
},
66
"projects": {
7-
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj": {
7+
"/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj": {
88
"version": "1.0.0",
99
"restore": {
10-
"projectUniqueName": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
10+
"projectUniqueName": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj",
1111
"projectName": "G42Cloud.SDK.Core",
12-
"projectPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
12+
"projectPath": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj",
1313
"packagesPath": "/root/.nuget/packages/",
14-
"outputPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/",
14+
"outputPath": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/obj/",
1515
"projectStyle": "PackageReference",
1616
"fallbackFolders": [
1717
"/usr/dotnet2/sdk/NuGetFallbackFolder"
@@ -23,7 +23,7 @@
2323
"netstandard2.0"
2424
],
2525
"sources": {
26-
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/package": {}
26+
"/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/package": {}
2727
},
2828
"frameworks": {
2929
"netstandard2.0": {

Core/obj/Core.csproj.nuget.g.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
44
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
55
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6-
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/project.assets.json</ProjectAssetsFile>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/obj/project.assets.json</ProjectAssetsFile>
77
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/root/.nuget/packages/</NuGetPackageRoot>
88
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/root/.nuget/packages/;/usr/dotnet2/sdk/NuGetFallbackFolder</NuGetPackageFolders>
99
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>

Core/obj/project.assets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,11 @@
10511051
"project": {
10521052
"version": "1.0.0",
10531053
"restore": {
1054-
"projectUniqueName": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
1054+
"projectUniqueName": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj",
10551055
"projectName": "G42Cloud.SDK.Core",
1056-
"projectPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
1056+
"projectPath": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/Core.csproj",
10571057
"packagesPath": "/root/.nuget/packages/",
1058-
"outputPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/",
1058+
"outputPath": "/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/Core/obj/",
10591059
"projectStyle": "PackageReference",
10601060
"fallbackFolders": [
10611061
"/usr/dotnet2/sdk/NuGetFallbackFolder"
@@ -1067,7 +1067,7 @@
10671067
"netstandard2.0"
10681068
],
10691069
"sources": {
1070-
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/package": {}
1070+
"/data/fuxi_ci_workspace/648bc163b7c5fa32ae3a3eb8/package": {}
10711071
},
10721072
"frameworks": {
10731073
"netstandard2.0": {

0 commit comments

Comments
 (0)