public void BasicRoaTokenConnection() { if (FeatureCommon.GetRoleArn().Equals("FakeRoleArn")) { return; } DefaultProfile.ClearProfile(); var basciCredential = new BasicSessionCredentials(FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret(), FeatureCommon.GetToken()); var profile = DefaultProfile.GetProfile(FeatureCommon.GetRegionId(), FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret()); var client = new DefaultAcsClient(profile, basciCredential); var request = new CommonRequest(); request.Domain = "ros.aliyuncs.com"; request.Version = "2015-09-01"; request.Action = "DescribeResourceTypes"; request.UriPattern = "/resource_types"; request.Method = MethodType.GET; var response = client.GetCommonResponse(request); Assert.Equal(200, response.HttpStatus); Assert.NotNull(response.Data); }
public void BasicRpcStsTokenConnectionsTest() { if (FeatureCommon.GetRoleArn().Equals("FakeRoleArn")) { return; } DefaultProfile.ClearProfile(); var basciCredential = new BasicSessionCredentials(FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret(), FeatureCommon.GetToken()); var profile = DefaultProfile.GetProfile(FeatureCommon.GetRegionId(), FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret()); var client = new DefaultAcsClient(profile, basciCredential); var request = new DescribeAccessControlListsRequest(); var response = client.GetAcsResponse(request); Assert.NotNull(response); }
public void UnicodeAndQueryTest() { if (FeatureCommon.GetRoleArn().Equals("FakeRoleArn")) { return; } DefaultProfile.ClearProfile(); var basciCredential = new BasicSessionCredentials(FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret(), FeatureCommon.GetToken()); var profile = DefaultProfile.GetProfile(FeatureCommon.GetRegionId(), FeatureCommon.GetBasicAccessKeyId(), FeatureCommon.GetBasicAccessKeySecret()); var client = new DefaultAcsClient(profile, basciCredential); var request = new CommonRequest(); request.TimeoutInMilliSeconds = 30000; request.Domain = "ros.aliyuncs.com"; request.Version = "2015-09-01"; request.Action = "DescribeResourceTypes"; request.UriPattern = "/resource_types"; request.Method = MethodType.GET; request.QueryParameters.Add("testParams", "SDFSDFSAetTEWTEWQO(∩_∩)O哈哈~"); var response = client.GetCommonResponse(request); Assert.Equal(200, response.HttpStatus); Assert.NotNull(response.Data); }