public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDeviceFarmConfig config = new AmazonDeviceFarmConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonDeviceFarmClient client = new AmazonDeviceFarmClient(creds, config);

            ListProjectsResponse resp = new ListProjectsResponse();

            do
            {
                ListProjectsRequest req = new ListProjectsRequest
                {
                    NextToken = resp.NextToken
                };

                resp = client.ListProjects(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Projects)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 2
0
        private string GetProjectArn(string projectName)
        {
            Project project   = null;
            string  nextToken = null;

            do
            {
                var response = DFClient.ListProjects(new ListProjectsRequest()
                {
                    NextToken = nextToken
                });
                nextToken = response.NextToken;
                foreach (var p in response.Projects)
                {
                    if (p.Name == projectName)
                    {
                        project = p;
                        break;
                    }
                }
            } while (project == null && !string.IsNullOrEmpty(nextToken));

            if (project != null)
            {
                Log.LogMessage("Found project named '{0}' with ARN '{1}'.", projectName, project.Arn);
            }
            else
            {
                project = DFClient.CreateProject(projectName).Project;
                Log.LogMessage("Created project named '{0}' with ARN '{1}'.", projectName, project.Arn);
            }

            return(project.Arn);
        }
Exemplo n.º 3
0
        public void DeviceFarmListProjects()
        {
            #region to-get-information-about-a-device-farm-project-1472564014388

            var client   = new AmazonDeviceFarmClient();
            var response = client.ListProjects(new ListProjectsRequest
            {
                Arn       = "arn:aws:devicefarm:us-west-2:123456789101:project:7ad300ed-8183-41a7-bf94-12345EXAMPLE",
                NextToken = "RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE" // A dynamically generated value, used for paginating results.
            });

            List <Project> projects = response.Projects;

            #endregion
        }