本文整理匯總了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))
}
示例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))
}
示例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)
}
}
}
示例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))
}
示例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))
}
示例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
}
示例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
}
示例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))
}
示例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))
}
示例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))
}
示例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)
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}