當前位置: 首頁>>代碼示例>>Golang>>正文


Golang devicefarm.DeviceFarm類代碼示例

本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/devicefarm.DeviceFarm的典型用法代碼示例。如果您正苦於以下問題:Golang DeviceFarm類的具體用法?Golang DeviceFarm怎麽用?Golang DeviceFarm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DeviceFarm類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: scheduleRun

/* Schedule Run */
func scheduleRun(svc *devicefarm.DeviceFarm, runName string, projectArn string, appUploadArn string, devicePoolArn string, testUploadArn string, testType string) {

	runTest := &devicefarm.ScheduleRunTest{
		Type: aws.String(testType),
		//Parameters: // test parameters
		//Filter: // filter to pass to tests
	}

	if testUploadArn != "" {
		runTest.TestPackageARN = aws.String(testUploadArn)
	}

	runReq := &devicefarm.ScheduleRunInput{
		AppARN:        aws.String(appUploadArn),
		DevicePoolARN: aws.String(devicePoolArn),
		Name:          aws.String(runName),
		ProjectARN:    aws.String(projectArn),
		Test:          runTest,
	}

	resp, err := svc.ScheduleRun(runReq)

	failOnErr(err, "error scheduling run")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:26,代碼來源:devicefarm-cli.go

示例2: createPoolFromDevice

func createPoolFromDevice(svc *devicefarm.DeviceFarm, poolName string, deviceName string, projectArn string) (poolArn string, poolErr error) {

	deviceArn, err := lookupDeviceArn(svc, deviceName)
	failOnErr(err, "error looking up device")

	fmt.Printf("creating %s", deviceArn)
	req := &devicefarm.CreateDevicePoolInput{
		Name:        aws.String(poolName),
		Description: aws.String("autocreated pool " + poolName),
		ProjectArn:  aws.String(projectArn),
		Rules: []*devicefarm.Rule{
			&devicefarm.Rule{
				Attribute: aws.String("Arn"),
				Operator:  aws.String("IN"),
				// Value: "[\"arn:aws:devicefarm:us-west-2::device:6A553F3B3D384DB1A780C590FCC7F85D\"]"
				Value: aws.String("[\"" + deviceArn + "\"]"),
			},
		},
	}

	resp, err := svc.CreateDevicePool(req)

	if err != nil {
		return "", err
	}

	return *resp.DevicePool.Arn, nil
	//fmt.Println(awsutil.Prettify(resp))
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:29,代碼來源:devicefarm-cli.go

示例3: downloadArtifacts

/* Download Artifacts */
func downloadArtifacts(svc *devicefarm.DeviceFarm, filterArn string, artifactType string) {

	debug := false
	if debug {
		fmt.Println(filterArn)
	}

	listReq := &devicefarm.ListArtifactsInput{
		Arn: aws.String(filterArn),
	}

	types := []string{"LOG", "SCREENSHOT", "FILE"}

	for _, each := range types {
		listReq.Type = aws.String(each)

		resp, err := svc.ListArtifacts(listReq)
		failOnErr(err, "error listing artifacts")

		for index, artifact := range resp.Artifacts {
			fileName := fmt.Sprintf("- report/%d-%s.%s", index, *artifact.Name, *artifact.Extension)
			downloadArtifact(fileName, artifact)
		}
	}

}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:27,代碼來源:devicefarm-cli.go

示例4: listProjects

/* List all Projects */
func listProjects(svc *devicefarm.DeviceFarm) {

	resp, err := svc.ListProjects(nil)
	failOnErr(err, "error listing projects")

	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:8,代碼來源:devicefarm-cli.go

示例5: listDevices

/* List all Devices */
func listDevices(svc *devicefarm.DeviceFarm) {

	input := &devicefarm.ListDevicesInput{}
	resp, err := svc.ListDevices(input)

	failOnErr(err, "error listing devices")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:9,代碼來源:devicefarm-cli.go

示例6: GetStatusOfRun

// GetStatusOfRun returns status and result of run specified by ARN
func GetStatusOfRun(client *devicefarm.DeviceFarm, arn string) (string, string) {
	params := &devicefarm.GetRunInput{
		Arn: aws.String(arn),
	}
	resp, err := client.GetRun(params)
	errors.Validate(err, "Can't get status of run")
	return *resp.Run.Status, *resp.Run.Result
}
開發者ID:artemnikitin,項目名稱:devicefarm-ci-tool,代碼行數:9,代碼來源:service.go

示例7: GetUploadStatus

// GetUploadStatus returns status of upload file
func GetUploadStatus(client *devicefarm.DeviceFarm, arn string) string {
	params := &devicefarm.GetUploadInput{
		Arn: aws.String(arn),
	}
	resp, err := client.GetUpload(params)
	errors.Validate(err, "Failed to get status of upload")
	log.Println("Status of upload:", *resp.Upload.Status)
	return *resp.Upload.Status
}
開發者ID:artemnikitin,項目名稱:devicefarm-ci-tool,代碼行數:10,代碼來源:service.go

示例8: jobInfo

/* Get Job Info */
func jobInfo(svc *devicefarm.DeviceFarm, jobArn string) {

	infoReq := &devicefarm.GetJobInput{
		ARN: aws.String(jobArn),
	}

	resp, err := svc.GetJob(infoReq)

	failOnErr(err, "error getting job info")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例9: listJobs

/* List Jobs */
func listJobs(svc *devicefarm.DeviceFarm, runArn string) {

	listReq := &devicefarm.ListJobsInput{
		ARN: aws.String(runArn),
	}

	resp, err := svc.ListJobs(listReq)

	failOnErr(err, "error listing jobs")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例10: listSuites

/* List suites */
func listSuites(svc *devicefarm.DeviceFarm, filterArn string) {

	listReq := &devicefarm.ListSuitesInput{
		ARN: aws.String(filterArn),
	}

	resp, err := svc.ListSuites(listReq)

	failOnErr(err, "error listing suites")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:dmreiland,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例11: runStatus

/* Get Run Status */
func runStatus(svc *devicefarm.DeviceFarm, runArn string) {

	infoReq := &devicefarm.GetRunInput{
		Arn: aws.String(runArn),
	}

	resp, err := svc.GetRun(infoReq)

	failOnErr(err, "error getting run info")
	fmt.Println(*resp.Run.Status)
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例12: listUploads

/* List all uploads */
func listUploads(svc *devicefarm.DeviceFarm, projectArn string) {

	listReq := &devicefarm.ListUploadsInput{
		Arn: aws.String(projectArn),
	}

	resp, err := svc.ListUploads(listReq)

	failOnErr(err, "error listing uploads")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例13: suiteInfo

/* Get Suite Info */
func suiteInfo(svc *devicefarm.DeviceFarm, suiteArn string) {

	infoReq := &devicefarm.GetJobInput{
		Arn: aws.String(suiteArn),
	}

	resp, err := svc.GetJob(infoReq)

	failOnErr(err, "error getting suite info")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例14: uploadInfo

/* Get Upload Info */
func uploadInfo(svc *devicefarm.DeviceFarm, uploadArn string) {

	uploadReq := &devicefarm.GetUploadInput{
		Arn: aws.String(uploadArn),
	}

	resp, err := svc.GetUpload(uploadReq)

	failOnErr(err, "error getting upload info")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go

示例15: listUniqueProblems

/* List all unique problems */
func listUniqueProblems(svc *devicefarm.DeviceFarm, runArn string) {

	listReq := &devicefarm.ListUniqueProblemsInput{
		Arn: aws.String(runArn),
	}

	resp, err := svc.ListUniqueProblems(listReq)

	failOnErr(err, "error listing problems")
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:ainoya,項目名稱:devicefarm-cli,代碼行數:12,代碼來源:devicefarm-cli.go


注:本文中的github.com/aws/aws-sdk-go/service/devicefarm.DeviceFarm類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。