Skip to content

Commit

Permalink
release 0.0.6-beta source code for net
Browse files Browse the repository at this point in the history
  • Loading branch information
unionsdk committed May 12, 2023
1 parent 081f0b2 commit 44e0d4d
Show file tree
Hide file tree
Showing 61 changed files with 782 additions and 3,734 deletions.
140 changes: 140 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,143 @@
# 0.0.6-beta 2023-05-12

### G42Cloud SDK CBR

- _Features_
- None
- _Bug Fix_
- None
- _Change_
- Remove the following interfaces:
- `CopyCheckpoint`
- `MigrateVaultResource`
- `ImportBackup`
- `CopyBackup`
- `ShowReplicationCapabilities`
- **ShowVaultResourceInstances**
- changes of response param
- `* resources.resource_detail: list<Vault> -> object<InstancesResourceDetail>`
- **ShowBackup**
- changes of response param
- `- backup.image_type: enum value [backup,replication]`
- `- backup.resource_type: enum value [OS::Nova::Server,OS::Cinder::Volume]`
- **ListBackups**
- changes of request param
- `+ incremental`
- `+ image_type: enum value [backup,replication]`
- `+ resource_type: enum value [OS::Cinder::Volume,OS::Nova::Server]`
- changes of response param
- `- backups.image_type: enum value [backup,replication]`
- `- backups.resource_type: enum value [OS::Nova::Server,OS::Cinder::Volume]`
- **ListPolicies**
- changes of response param
- `- policies.operation_type: enum value [replication]`
- **CreatePolicy**
- changes of request param
- `- policy.operation_type: enum value [backup,replication]`
- changes of response param
- `- policy.operation_type: enum value [replication]`
- **ShowPolicy**
- changes of response param
- `- policy.operation_type: enum value [replication]`
- **UpdatePolicy**
- changes of response param
- `- policy.operation_type: enum value [replication]`
- **ListVault**
- changes of request param
- `+ cloud_type: enum value [public,hybrid]`
- `+ protect_type: enum value [backup,replication]`
- changes of response param
- `- vaults.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- vaults.billing.cloud_type: enum value [public,hybrid]`
- `- vaults.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- vaults.billing.object_type: enum value [server,disk]`
- `- vaults.billing.protect_type: enum value [backup,replication,hybrid]`
- `- vaults.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `* vaults.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- **CreateVault**
- changes of request param
- `* vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- `+ vault.billing.promotion_info`
- `+ vault.billing.purchase_mode`
- `+ vault.billing.order_id`
- `- vault.billing.cloud_type: enum value [public,hybrid]`
- `- vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- vault.billing.object_type: enum value [server,disk,turbo]`
- `- vault.billing.protect_type: enum value [backup,replication]`
- `- vault.billing.charging_mode: enum value [post_paid,pre_paid]`
- changes of response param
- `- vault.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- vault.billing.cloud_type: enum value [public,hybrid]`
- `- vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- vault.billing.object_type: enum value [server,disk]`
- `- vault.billing.protect_type: enum value [backup,replication,hybrid]`
- `- vault.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `* vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- **ShowVault**
- changes of response param
- `- vault.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- vault.billing.cloud_type: enum value [public,hybrid]`
- `- vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- vault.billing.object_type: enum value [server,disk]`
- `- vault.billing.protect_type: enum value [backup,replication,hybrid]`
- `- vault.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `* vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- **UpdateVault**
- changes of request param
- `* vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- changes of response param
- `- vault.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- vault.billing.cloud_type: enum value [public,hybrid]`
- `- vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- vault.billing.object_type: enum value [server,disk]`
- `- vault.billing.protect_type: enum value [backup,replication,hybrid]`
- `- vault.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `* vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- **ListProtectable**
- changes of response param
- `- instances.protectable.vault.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- instances.protectable.vault.billing.cloud_type: enum value [public,hybrid]`
- `- instances.protectable.vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- instances.protectable.vault.billing.object_type: enum value [server,disk]`
- `- instances.protectable.vault.billing.protect_type: enum value [backup,replication,hybrid]`
- `- instances.protectable.vault.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `+ instances.protectable.vault.tags.value`
- `- instances.protectable.vault.tags.values`
- `* instances.protectable.vault.tags: list<TagsResp> -> list<Tag>`
- `* instances.protectable.vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`
- **ShowProtectable**
- changes of response param
- `- instance.protectable.vault.billing.charging_mode: enum value [pre_paid,post_paid]`
- `- instance.protectable.vault.billing.cloud_type: enum value [public,hybrid]`
- `- instance.protectable.vault.billing.consistent_level: enum value [app_consistent,crash_consistent]`
- `- instance.protectable.vault.billing.object_type: enum value [server,disk]`
- `- instance.protectable.vault.billing.protect_type: enum value [backup,replication,hybrid]`
- `- instance.protectable.vault.billing.spec_code: enum value [vault.backup.server.normal,vault.backup.volume.normal]`
- `+ instance.protectable.vault.tags.value`
- `- instance.protectable.vault.tags.values`
- `* instance.protectable.vault.tags: list<TagsResp> -> list<Tag>`
- `* instance.protectable.vault.bind_rules.tags: list<Tag> -> list<BindRulesTags>`

### 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.5-beta 2023-04-14

### G42Cloud SDK Core
Expand Down
30 changes: 15 additions & 15 deletions Core/Http/SdkHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down Expand Up @@ -54,15 +55,8 @@ private IServiceCollection GetServiceCollection(HttpConfig httpConfig, bool logg
var service = new ServiceCollection()
.AddHttpClient(
"SdkHttpClient",
x => { x.Timeout = TimeSpan.FromSeconds(httpConfig.Timeout.Value); }
)
.AddTransientHttpErrorPolicy(builder => builder.WaitAndRetryAsync(new[]
{
TimeSpan.FromSeconds(3),
TimeSpan.FromSeconds(3),
TimeSpan.FromSeconds(3)
}))
.ConfigurePrimaryHttpMessageHandler(
x => { x.Timeout = TimeSpan.FromSeconds(httpConfig.Timeout ?? 60); }
).ConfigurePrimaryHttpMessageHandler(
() => new HwMessageHandlerFactory(httpConfig).GetHandler()
)
.Services;
Expand Down Expand Up @@ -142,10 +136,10 @@ private HttpContent GetFormDataContent(HttpRequest request)
{
var boundary = Guid.NewGuid().ToString("N");
var contentType = "multipart/form-data; boundary=" + boundary;
var content = new MultipartFormDataContent(boundary);
var multipartContent = new MultipartFormDataContent(boundary);
request.Headers.Add("ContentType", contentType);
content.Headers.Remove("Content-Type");
content.Headers.TryAddWithoutValidation("Content-Type", contentType);
multipartContent.Headers.Remove("Content-Type");
multipartContent.Headers.TryAddWithoutValidation("Content-Type", contentType);

var fileParts = new Dictionary<string, FormDataFilePart>();

Expand All @@ -157,7 +151,7 @@ private HttpContent GetFormDataContent(HttpRequest request)
}
else
{
content.Add(new StringContent(pair.Value.ToString()), $"\"{pair.Key}\"");
multipartContent.Add(new StringContent(pair.Value.ToString()), $"\"{pair.Key}\"");
}
}

Expand All @@ -169,10 +163,16 @@ private HttpContent GetFormDataContent(HttpRequest request)
{
streamContent.Headers.ContentType = new MediaTypeHeaderValue(filePart.GetContentType());
}
content.Add(streamContent, $"\"{pair.Key}\"", $"\"{filePart.GetFilename()}\"");
multipartContent.Add(streamContent, $"\"{pair.Key}\"", $"\"{filePart.GetFilename()}\"");
}

foreach (var content in multipartContent) {
var headerContent = content.Headers.ContentDisposition.Parameters.SingleOrDefault(x => x.Name == "filename*");
if(headerContent != null)
content.Headers.ContentDisposition.Parameters.Remove(headerContent);
}

return content;
return multipartContent;
}

public async Task<HttpResponseMessage> DoHttpRequest(HttpRequestMessage request)
Expand Down
7 changes: 6 additions & 1 deletion Core/SdkResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@
* under the License.
*/

using Newtonsoft.Json;

namespace G42Cloud.SDK.Core
{
public class SdkResponse
{
[JsonIgnore]
public string HttpBody { get; set; }

[JsonIgnore]
public int? HttpStatusCode { get; set; }

[JsonIgnore]
public string HttpHeaders { get; set; }

public string GetHttpBody()
Expand All @@ -44,4 +49,4 @@ public string GetHttpHeaders()
return this.HttpHeaders;
}
}
}
}
2 changes: 1 addition & 1 deletion Core/obj/Core.csproj.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1,
"dgSpecHash": "ni+h4mW2edx+EFg4KH0Mp+ym7+P9OvG1mggreTiYLE4kXYEpbQaDt++JEUapSOMlibFYboN1p8YL5vvJDxf61A==",
"dgSpecHash": "/uxPzudilK7z2cmcr8LmLAMNuQ3d4mkPcnRYFwycy3PGe6bg0rL/aXKhMoaCKTAGOwJqw+661uZhyMwQHaDr9w==",
"success": true
}
12 changes: 6 additions & 6 deletions Core/obj/Core.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"format": 1,
"restore": {
"/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj": {}
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj": {}
},
"projects": {
"/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj": {
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj",
"projectUniqueName": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
"projectName": "G42Cloud.SDK.Core",
"projectPath": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj",
"projectPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
"packagesPath": "/root/.nuget/packages/",
"outputPath": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/obj/",
"outputPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/",
"projectStyle": "PackageReference",
"fallbackFolders": [
"/usr/dotnet2/sdk/NuGetFallbackFolder"
Expand All @@ -23,7 +23,7 @@
"netstandard2.0"
],
"sources": {
"/data/fuxi_ci_workspace/6438ba837f701874a66183c8/package": {}
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/package": {}
},
"frameworks": {
"netstandard2.0": {
Expand Down
2 changes: 1 addition & 1 deletion Core/obj/Core.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/obj/project.assets.json</ProjectAssetsFile>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/root/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/root/.nuget/packages/;/usr/dotnet2/sdk/NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
Expand Down
8 changes: 4 additions & 4 deletions Core/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj",
"projectUniqueName": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
"projectName": "G42Cloud.SDK.Core",
"projectPath": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/Core.csproj",
"projectPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/Core.csproj",
"packagesPath": "/root/.nuget/packages/",
"outputPath": "/data/fuxi_ci_workspace/6438ba837f701874a66183c8/Core/obj/",
"outputPath": "/data/fuxi_ci_workspace/645dd8e482590b0998f24562/Core/obj/",
"projectStyle": "PackageReference",
"fallbackFolders": [
"/usr/dotnet2/sdk/NuGetFallbackFolder"
Expand All @@ -1067,7 +1067,7 @@
"netstandard2.0"
],
"sources": {
"/data/fuxi_ci_workspace/6438ba837f701874a66183c8/package": {}
"/data/fuxi_ci_workspace/645dd8e482590b0998f24562/package": {}
},
"frameworks": {
"netstandard2.0": {
Expand Down
Loading

0 comments on commit 44e0d4d

Please sign in to comment.