-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release 3.0.11-beta source code for net
- Loading branch information
1 parent
701cf91
commit a335e64
Showing
304 changed files
with
35,597 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"dgSpecHash": "BI/WayeYc4X+hcAXtNz5hJGzp8qW8s1edxDEcioStmcg3359OM+gFIWHqsxtOLlikoqGzpLQVPcYih1jfr4f9g==", | ||
"dgSpecHash": "z7RJzV4Vv6G6+/PXfWMLYDkzO0NZuQpvremnOJZg9a1Pzpr45eGJYrgDaze4DdQa0JjIsVypLRDUIzYDtLTzWQ==", | ||
"success": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using HuaweiCloud.SDK.Core; | ||
using HuaweiCloud.SDK.Core.Auth; | ||
using HuaweiCloud.SDK.Dms.V2; | ||
using HuaweiCloud.SDK.Dms.V2.Model; | ||
|
||
namespace Examples.Dms.V2 | ||
{ | ||
public class ConsumeGroup | ||
{ | ||
private const string ak = "{your ak string}"; | ||
private const string sk = "{your sk string}"; | ||
private const string endpoint = "{your endpoint}"; | ||
private const string projectId = "{your project id}"; | ||
private const string queueId = "{your queue id}"; | ||
|
||
private static void ConsumeGroupMain(string[] args) | ||
{ | ||
var config = HttpConfig.GetDefaultConfig(); | ||
config.IgnoreSslVerification = true; | ||
var auth = new BasicCredentials(ak, sk, projectId); | ||
var dmsClient = DmsClient.NewBuilder() | ||
.WithCredential(auth) | ||
.WithEndPoint(endpoint) | ||
.WithHttpConfig(config).Build(); | ||
|
||
// CreateConsumerGroup(dmsClient); | ||
listConsumerGroups(dmsClient); | ||
} | ||
|
||
private static void CreateConsumerGroup(DmsClient client) | ||
{ | ||
var groupEntity = new GroupEntity | ||
{ | ||
Name = "gourp-test", | ||
}; | ||
var req = new CreateConsumerGroupRequest() | ||
{ | ||
QueueId = queueId, | ||
Body = new CreateConsumerGroupReq | ||
{ | ||
Groups = new List<GroupEntity>() {groupEntity} | ||
} | ||
}; | ||
|
||
try | ||
{ | ||
var resp = client.CreateConsumerGroup(req); | ||
Console.WriteLine(resp.GetHttpBody()); | ||
} | ||
catch (RequestTimeoutException requestTimeoutException) | ||
{ | ||
Console.WriteLine(requestTimeoutException.ErrorMessage); | ||
} | ||
catch (ServiceResponseException clientRequestException) | ||
{ | ||
Console.WriteLine(clientRequestException.HttpStatusCode); | ||
Console.WriteLine(clientRequestException.ErrorCode); | ||
Console.WriteLine(clientRequestException.ErrorMsg); | ||
} | ||
catch (ConnectionException connectionException) | ||
{ | ||
Console.WriteLine(connectionException.ErrorMessage); | ||
} | ||
} | ||
|
||
private static void listConsumerGroups(DmsClient client) | ||
{ | ||
var req = new ListConsumerGroupsRequest | ||
{ | ||
QueueId = queueId, | ||
}; | ||
|
||
try | ||
{ | ||
var resp = client.ListConsumerGroups(req); | ||
Console.WriteLine(resp.GetHttpBody()); | ||
} | ||
catch (RequestTimeoutException requestTimeoutException) | ||
{ | ||
Console.WriteLine(requestTimeoutException.ErrorMessage); | ||
} | ||
catch (ServiceResponseException clientRequestException) | ||
{ | ||
Console.WriteLine(clientRequestException.HttpStatusCode); | ||
Console.WriteLine(clientRequestException.ErrorCode); | ||
Console.WriteLine(clientRequestException.ErrorMsg); | ||
} | ||
catch (ConnectionException connectionException) | ||
{ | ||
Console.WriteLine(connectionException.ErrorMessage); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
using System; | ||
using HuaweiCloud.SDK.Core; | ||
using HuaweiCloud.SDK.Core.Auth; | ||
using HuaweiCloud.SDK.Dms.V2; | ||
using HuaweiCloud.SDK.Dms.V2.Model; | ||
|
||
namespace Examples.Dms.V2 | ||
{ | ||
public class QueueMgt | ||
{ | ||
private const string ak = "{your ak string}"; | ||
private const string sk = "{your sk string}"; | ||
private const string endpoint = "{your endpoint}"; | ||
private const string projectId = "{your project id}"; | ||
private const string queueId = "{your queue id}"; | ||
|
||
private static void QueueMgtMain(string[] args) | ||
{ | ||
var config = HttpConfig.GetDefaultConfig(); | ||
config.IgnoreSslVerification = true; | ||
var auth = new BasicCredentials(ak, sk, projectId); | ||
var dmsClient = DmsClient.NewBuilder() | ||
.WithCredential(auth) | ||
.WithEndPoint(endpoint) | ||
.WithHttpConfig(config).Build(); | ||
|
||
// listQueues(dmsClient); | ||
CreateQueue(dmsClient); | ||
//deleteQueue(dmsClient); | ||
} | ||
|
||
private static void listQueues(DmsClient client) | ||
{ | ||
var req = new ListQueuesRequest(); | ||
|
||
try | ||
{ | ||
var resp = client.ListQueues(req); | ||
Console.WriteLine(resp.GetHttpBody()); | ||
} | ||
catch (RequestTimeoutException requestTimeoutException) | ||
{ | ||
Console.WriteLine(requestTimeoutException.ErrorMessage); | ||
} | ||
catch (ServiceResponseException clientRequestException) | ||
{ | ||
Console.WriteLine(clientRequestException.HttpStatusCode); | ||
Console.WriteLine(clientRequestException.ErrorCode); | ||
Console.WriteLine(clientRequestException.ErrorMsg); | ||
} | ||
catch (ConnectionException connectionException) | ||
{ | ||
Console.WriteLine(connectionException.ErrorMessage); | ||
} | ||
} | ||
|
||
private static void CreateQueue(DmsClient client) | ||
{ | ||
var req = new CreateQueueRequest | ||
{ | ||
Body = new CreateQueueReq | ||
{ | ||
Name = "queue-test", | ||
} | ||
}; | ||
|
||
try | ||
{ | ||
var resp = client.CreateQueue(req); | ||
Console.WriteLine(resp.GetHttpBody()); | ||
} | ||
catch (RequestTimeoutException requestTimeoutException) | ||
{ | ||
Console.WriteLine(requestTimeoutException.ErrorMessage); | ||
} | ||
catch (ServiceResponseException clientRequestException) | ||
{ | ||
Console.WriteLine(clientRequestException.HttpStatusCode); | ||
Console.WriteLine(clientRequestException.ErrorCode); | ||
Console.WriteLine(clientRequestException.ErrorMsg); | ||
} | ||
catch (ConnectionException connectionException) | ||
{ | ||
Console.WriteLine(connectionException.ErrorMessage); | ||
} | ||
} | ||
|
||
private static void deleteQueue(DmsClient client) | ||
{ | ||
var req = new DeleteQueueRequest() | ||
{ | ||
QueueId = queueId, | ||
}; | ||
|
||
try | ||
{ | ||
var resp = client.DeleteQueue(req); | ||
Console.WriteLine(resp.GetHttpBody()); | ||
} | ||
catch (RequestTimeoutException requestTimeoutException) | ||
{ | ||
Console.WriteLine(requestTimeoutException.ErrorMessage); | ||
} | ||
catch (ServiceResponseException clientRequestException) | ||
{ | ||
Console.WriteLine(clientRequestException.HttpStatusCode); | ||
Console.WriteLine(clientRequestException.ErrorCode); | ||
Console.WriteLine(clientRequestException.ErrorMsg); | ||
} | ||
catch (ConnectionException connectionException) | ||
{ | ||
Console.WriteLine(connectionException.ErrorMessage); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.