本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/devicefarm.DeviceFarm类的典型用法代码示例。如果您正苦于以下问题:Golang DeviceFarm类的具体用法?Golang DeviceFarm怎么用?Golang DeviceFarm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DeviceFarm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: runInfo
/* Get Run Info */
func runInfo(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(awsutil.Prettify(resp))
}
开发者ID:ainoya,项目名称:devicefarm-cli,代码行数:12,代码来源:devicefarm-cli.go
示例17: listDevicePools
/* List all DevicePools */
func listDevicePools(svc *devicefarm.DeviceFarm, projectArn string) {
// CURATED: A device pool that is created and managed by AWS Device Farm.
// PRIVATE: A device pool that is created and managed by the device pool developer.
pool := &devicefarm.ListDevicePoolsInput{
Arn: aws.String(projectArn),
}
resp, err := svc.ListDevicePools(pool)
failOnErr(err, "error listing device pools")
fmt.Println(awsutil.Prettify(resp))
}
开发者ID:ainoya,项目名称:devicefarm-cli,代码行数:13,代码来源:devicefarm-cli.go
示例18: internalCreateUpload
func internalCreateUpload(client *devicefarm.DeviceFarm, arn, appPath, appType string) (string, string) {
params := &devicefarm.CreateUploadInput{
Name: aws.String(tools.GetFileName(appPath)),
ProjectArn: aws.String(arn),
Type: aws.String(appType),
ContentType: aws.String("application/octet-stream"),
}
resp, err := client.CreateUpload(params)
errors.Validate(err, "Failed to upload an app")
log.Println("Upload ARN:", *resp.Upload.Arn)
log.Println("Upload URL:", *resp.Upload.Url)
return *resp.Upload.Arn, *resp.Upload.Url
}
开发者ID:artemnikitin,项目名称:devicefarm-ci-tool,代码行数:13,代码来源:service.go
示例19: uploadCreate
/* Create an upload */
func uploadCreate(svc *devicefarm.DeviceFarm, uploadName string, uploadType string, projectArn string) {
uploadReq := &devicefarm.CreateUploadInput{
Name: aws.String(uploadName),
ProjectArn: aws.String(projectArn),
Type: aws.String(uploadType),
}
resp, err := svc.CreateUpload(uploadReq)
failOnErr(err, "error creating upload")
fmt.Println(awsutil.Prettify(resp))
}
开发者ID:ainoya,项目名称:devicefarm-cli,代码行数:14,代码来源:devicefarm-cli.go
示例20: GetProjectArn
// GetProjectArn returns project ARN by project name
func GetProjectArn(client *devicefarm.DeviceFarm, project string) string {
var arn string
params := &devicefarm.ListProjectsInput{}
resp, err := client.ListProjects(params)
errors.Validate(err, "Failed to get list of projects for account")
for _, entry := range resp.Projects {
if *entry.Name == project {
arn = *entry.Arn
}
}
log.Println("Project ARN:", arn)
return arn
}
开发者ID:artemnikitin,项目名称:devicefarm-ci-tool,代码行数:14,代码来源:service.go
注:本文中的github.com/aws/aws-sdk-go/service/devicefarm.DeviceFarm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论