| 1 | package ess |
| 2 | |
| 3 | import ( |
| 4 | "github.com/denverdino/aliyungo/common" |
| 5 | "github.com/denverdino/aliyungo/ecs" |
| 6 | ) |
| 7 | |
| 8 | const ( |
| 9 | TestAccessKeyId = "MY_ACCESS_KEY_ID" |
| 10 | TestAccessKeySecret = "MY_ACCESS_KEY_SECRET" |
| 11 | RegionId = "MY_TEST_REGION" |
| 12 | ScalingGroupId = "MY_TEST_SCALING_GROUP_ID" |
| 13 | TestInstanceId = "MY_TEST_INSTANCE_ID" |
| 14 | TestRuleArn = "MY_TEST_RULE_ARN" |
| 15 | TestScheduleLaunchTime = "MY_TEST_SCHEDULE_LAUNCH_TIME" |
| 16 | TestIAmRich = false |
| 17 | ) |
| 18 | |
| 19 | var testClient *Client |
| 20 | |
| 21 | func NewTestClient(regionId common.Region) *Client { |
| 22 | if testClient == nil { |
| 23 | testClient = NewESSClient(TestAccessKeyId, TestAccessKeySecret, regionId) |
| 24 | } |
| 25 | return testClient |
| 26 | } |
| 27 | |
| 28 | var testDebugClient *Client |
| 29 | |
| 30 | func NewTestClientForDebug(regionId common.Region) *Client { |
| 31 | if testDebugClient == nil { |
| 32 | testDebugClient = NewESSClient(TestAccessKeyId, TestAccessKeySecret, regionId) |
| 33 | testDebugClient.SetDebug(true) |
| 34 | } |
| 35 | return testDebugClient |
| 36 | } |
| 37 | |
| 38 | var testEcsClient *ecs.Client |
| 39 | |
| 40 | func NewTestEcsClient(regionId common.Region) *ecs.Client { |
| 41 | if testEcsClient == nil { |
| 42 | testEcsClient = ecs.NewECSClient(TestAccessKeyId, TestAccessKeySecret, regionId) |
| 43 | } |
| 44 | return testEcsClient |
| 45 | } |