本文整理汇总了Golang中github.com/skelterjohn/gcloud_apis/commands_util.PrintResponse函数的典型用法代码示例。如果您正苦于以下问题:Golang PrintResponse函数的具体用法?Golang PrintResponse怎么用?Golang PrintResponse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintResponse函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Bigtableadmin_v2_OperationsCancel
func Bigtableadmin_v2_OperationsCancel(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("operationsId"))
if len(pathParams) != 0 {
if strings.Contains("v2/operations/{operationsId}:cancel", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewOperationsService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"operationsId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_operationsId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
call := service.Cancel(param_operationsId)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:58,代码来源:bigtableadmin_v2.go
示例2: Cloudfunctions_v1beta1_ProjectsRegionsFunctionsGet
func Cloudfunctions_v1beta1_ProjectsRegionsFunctionsGet(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("name"))
if len(pathParams) != 0 {
if strings.Contains("v1beta1/{+name}", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsRegionsFunctionsService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"name",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_name, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
call := service.Get(param_name)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:58,代码来源:cloudfunctions_v1beta1.go
示例3: Sql_v1beta3_FlagsList
func Sql_v1beta3_FlagsList(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
if len(pathParams) != 0 {
if strings.Contains("flags", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewFlagsService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
call := service.List()
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:50,代码来源:sqladmin_v1beta3.go
示例4: Replicapoolupdater_v1beta1_RollingUpdatesListInstanceUpdates
//.........这里部分代码省略.........
usageBits += " [--filter=VALUE]"
usageBits += " [--maxResults=VALUE]"
usageBits += " [--pageToken=VALUE]"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewRollingUpdatesService(api_service)
queryParamNames := map[string]bool{
"filter": false,
"maxResults": false,
"pageToken": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"project",
"zone",
"rollingUpdate",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_project, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_zone, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_rollingUpdate, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
call := service.ListInstanceUpdates(param_project, param_zone, param_rollingUpdate)
// Set query parameters.
if value, ok := flagValues["filter"]; ok {
query_filter, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.Filter(query_filter)
}
if value, ok := flagValues["maxResults"]; ok {
query_maxResults, err := commands_util.ConvertValue_int64(value)
if err != nil {
return err
}
call.MaxResults(query_maxResults)
}
if value, ok := flagValues["pageToken"]; ok {
query_pageToken, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.PageToken(query_pageToken)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:replicapoolupdater_v1beta1.go
示例5: Clouduseraccounts_alpha_GlobalAccountsOperationsGet
func Clouduseraccounts_alpha_GlobalAccountsOperationsGet(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("project"))
pathParams = append(pathParams, commands_util.AngrySnakes("operation"))
if len(pathParams) != 0 {
if strings.Contains("{project}/global/operations/{operation}", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewGlobalAccountsOperationsService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"project",
"operation",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_project, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_operation, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
call := service.Get(param_project, param_operation)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:64,代码来源:clouduseraccounts_alpha.go
示例6: Clouderrorreporting_v1beta1_ProjectsGroupStatsList
//.........这里部分代码省略.........
expectedParams := []string{
"projectName",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectName, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
call := service.List(param_projectName)
// Set query parameters.
if value, ok := flagValues["alignment"]; ok {
query_alignment, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.Alignment(query_alignment)
}
if value, ok := flagValues["alignmentTime"]; ok {
query_alignmentTime, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.AlignmentTime(query_alignmentTime)
}
if value, ok := flagValues["groupId"]; ok {
query_groupId, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.GroupId(query_groupId)
}
if value, ok := flagValues["order"]; ok {
query_order, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.Order(query_order)
}
if value, ok := flagValues["pageSize"]; ok {
query_pageSize, err := commands_util.ConvertValue_int64(value)
if err != nil {
return err
}
call.PageSize(query_pageSize)
}
if value, ok := flagValues["pageToken"]; ok {
query_pageToken, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.PageToken(query_pageToken)
}
if value, ok := flagValues["serviceFilter_service"]; ok {
query_serviceFilter_service, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.ServiceFilterService(query_serviceFilter_service)
}
if value, ok := flagValues["serviceFilter_version"]; ok {
query_serviceFilter_version, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.ServiceFilterVersion(query_serviceFilter_version)
}
if value, ok := flagValues["timeRange_period"]; ok {
query_timeRange_period, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.TimeRangePeriod(query_timeRange_period)
}
if value, ok := flagValues["timedCountDuration"]; ok {
query_timedCountDuration, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.TimedCountDuration(query_timedCountDuration)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:clouderrorreporting_v1beta1.go
示例7: Clouddebugger_v2_DebuggerDebuggeesBreakpointsSet
//.........这里部分代码省略.........
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"
usageBits += " [--clientVersion=VALUE]"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
commands_util.PrintRequestExample(&api_client.Breakpoint{})
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewDebuggerDebuggeesBreakpointsService(api_service)
queryParamNames := map[string]bool{
"clientVersion": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.Breakpoint{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
// Any flags that aren't query parameters are applied to the request.
keyValues := map[string]string{}
for k, v := range flagValues {
if _, ok := queryParamNames[k]; !ok {
keyValues[k] = v
}
}
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{
"debuggeeId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_debuggeeId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
call := service.Set(param_debuggeeId,
request,
)
// Set query parameters.
if value, ok := flagValues["clientVersion"]; ok {
query_clientVersion, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.ClientVersion(query_clientVersion)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:clouddebugger_v2.go
示例8: Clouddebugger_v2_ControllerDebuggeesRegister
func Clouddebugger_v2_ControllerDebuggeesRegister(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
if len(pathParams) != 0 {
if strings.Contains("v2/controller/debuggees/register", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
commands_util.PrintRequestExample(&api_client.RegisterDebuggeeRequest{})
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewControllerDebuggeesService(api_service)
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.RegisterDebuggeeRequest{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
keyValues := flagValues
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
call := service.Register(
request,
)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:75,代码来源:clouddebugger_v2.go
示例9: Appengine_v1beta5_AppsServicesPatch
//.........这里部分代码省略.........
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
commands_util.PrintRequestExample(&api_client.Service{})
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewAppsServicesService(api_service)
queryParamNames := map[string]bool{
"mask": false,
"migrateTraffic": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.Service{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
// Any flags that aren't query parameters are applied to the request.
keyValues := map[string]string{}
for k, v := range flagValues {
if _, ok := queryParamNames[k]; !ok {
keyValues[k] = v
}
}
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{
"name",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_name, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
call := service.Patch(param_name,
request,
)
// Set query parameters.
if value, ok := flagValues["mask"]; ok {
query_mask, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.Mask(query_mask)
}
if value, ok := flagValues["migrateTraffic"]; ok {
query_migrateTraffic, err := commands_util.ConvertValue_bool(value)
if err != nil {
return err
}
call.MigrateTraffic(query_migrateTraffic)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:appengine_v1beta5.go
示例10: Bigtableadmin_v2_ProjectsInstancesTablesGet
func Bigtableadmin_v2_ProjectsInstancesTablesGet(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("projectsId"))
pathParams = append(pathParams, commands_util.AngrySnakes("instancesId"))
pathParams = append(pathParams, commands_util.AngrySnakes("tablesId"))
if len(pathParams) != 0 {
if strings.Contains("v2/projects/{projectsId}/instances/{instancesId}/tables/{tablesId}", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [--view=VALUE]"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsInstancesTablesService(api_service)
queryParamNames := map[string]bool{
"view": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"projectsId",
"instancesId",
"tablesId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectsId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_instancesId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_tablesId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
call := service.Get(param_projectsId, param_instancesId, param_tablesId)
// Set query parameters.
if value, ok := flagValues["view"]; ok {
query_view, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.View(query_view)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:96,代码来源:bigtableadmin_v2.go
示例11: Bigtableadmin_v2_ProjectsInstancesTablesModifyColumnFamilies
func Bigtableadmin_v2_ProjectsInstancesTablesModifyColumnFamilies(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("projectsId"))
pathParams = append(pathParams, commands_util.AngrySnakes("instancesId"))
pathParams = append(pathParams, commands_util.AngrySnakes("tablesId"))
if len(pathParams) != 0 {
if strings.Contains("v2/projects/{projectsId}/instances/{instancesId}/tables/{tablesId}:modifyColumnFamilies", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
commands_util.PrintRequestExample(&api_client.ModifyColumnFamiliesRequest{})
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsInstancesTablesService(api_service)
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.ModifyColumnFamiliesRequest{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
keyValues := flagValues
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{
"projectsId",
"instancesId",
"tablesId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectsId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_instancesId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_tablesId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
call := service.ModifyColumnFamilies(param_projectsId, param_instancesId, param_tablesId,
request,
)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:95,代码来源:bigtableadmin_v2.go
示例12: Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsGet
func Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsGet(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("projectId"))
pathParams = append(pathParams, commands_util.AngrySnakes("historyId"))
pathParams = append(pathParams, commands_util.AngrySnakes("executionId"))
pathParams = append(pathParams, commands_util.AngrySnakes("stepId"))
if len(pathParams) != 0 {
if strings.Contains("{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsHistoriesExecutionsStepsService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"projectId",
"historyId",
"executionId",
"stepId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_historyId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_executionId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
param_stepId, err := commands_util.ConvertValue_string(paramValues[3])
if err != nil {
return err
}
call := service.Get(param_projectId, param_historyId, param_executionId, param_stepId)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:76,代码来源:toolresults_v1beta3.go
示例13: Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsPatch
//.........这里部分代码省略.........
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsHistoriesExecutionsStepsService(api_service)
queryParamNames := map[string]bool{
"requestId": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.Step{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
// Any flags that aren't query parameters are applied to the request.
keyValues := map[string]string{}
for k, v := range flagValues {
if _, ok := queryParamNames[k]; !ok {
keyValues[k] = v
}
}
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{
"projectId",
"historyId",
"executionId",
"stepId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_historyId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_executionId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
param_stepId, err := commands_util.ConvertValue_string(paramValues[3])
if err != nil {
return err
}
call := service.Patch(param_projectId, param_historyId, param_executionId, param_stepId,
request,
)
// Set query parameters.
if value, ok := flagValues["requestId"]; ok {
query_requestId, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.RequestId(query_requestId)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:toolresults_v1beta3.go
示例14: Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsThumbnailsList
//.........这里部分代码省略.........
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [--pageSize=VALUE]"
usageBits += " [--pageToken=VALUE]"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsHistoriesExecutionsStepsThumbnailsService(api_service)
queryParamNames := map[string]bool{
"pageSize": false,
"pageToken": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"projectId",
"historyId",
"executionId",
"stepId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_historyId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_executionId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
param_stepId, err := commands_util.ConvertValue_string(paramValues[3])
if err != nil {
return err
}
call := service.List(param_projectId, param_historyId, param_executionId, param_stepId)
// Set query parameters.
if value, ok := flagValues["pageSize"]; ok {
query_pageSize, err := commands_util.ConvertValue_int64(value)
if err != nil {
return err
}
call.PageSize(query_pageSize)
}
if value, ok := flagValues["pageToken"]; ok {
query_pageToken, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.PageToken(query_pageToken)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:toolresults_v1beta3.go
示例15: Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsPublishXunitXmlFiles
func Toolresults_v1beta3_ProjectsHistoriesExecutionsStepsPublishXunitXmlFiles(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("projectId"))
pathParams = append(pathParams, commands_util.AngrySnakes("historyId"))
pathParams = append(pathParams, commands_util.AngrySnakes("executionId"))
pathParams = append(pathParams, commands_util.AngrySnakes("stepId"))
if len(pathParams) != 0 {
if strings.Contains("{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}:publishXunitXmlFiles", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [REQUEST_FILE|-] [--REQUEST_KEY=VALUE]*"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
commands_util.PrintRequestExample(&api_client.PublishXunitXmlFilesRequest{})
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsHistoriesExecutionsStepsService(api_service)
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
// Only positional arguments should remain in args.
if len(args) == 0 || len(args) > 2 {
usageFunc()
}
request := &api_client.PublishXunitXmlFilesRequest{}
if len(args) == 2 {
err = commands_util.PopulateRequestFromFilename(&request, args[1])
if err != nil {
return err
}
}
keyValues := flagValues
err = commands_util.OverwriteRequestWithValues(&request, keyValues)
if err != nil {
return err
}
expectedParams := []string{
"projectId",
"historyId",
"executionId",
"stepId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_historyId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_executionId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
param_stepId, err := commands_util.ConvertValue_string(paramValues[3])
if err != nil {
return err
}
call := service.PublishXunitXmlFiles(param_projectId, param_historyId, param_executionId, param_stepId,
request,
)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:toolresults_v1beta3.go
示例16: Genomics_v1alpha2_PipelinesList
func Genomics_v1alpha2_PipelinesList(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
if len(pathParams) != 0 {
if strings.Contains("v1alpha2/pipelines", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
usageBits += " [--namePrefix=VALUE]"
usageBits += " [--pageSize=VALUE]"
usageBits += " [--pageToken=VALUE]"
usageBits += " [--projectId=VALUE]"
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewPipelinesService(api_service)
queryParamNames := map[string]bool{
"namePrefix": false,
"pageSize": false,
"pageToken": false,
"projectId": false,
}
args, flagValues, err := commands_util.ExtractFlagValues(args)
if err != nil {
return err
}
for k, r := range queryParamNames {
if _, ok := flagValues[k]; r && !ok {
return fmt.Errorf("missing required flag %q", "--"+k)
}
}
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
call := service.List()
// Set query parameters.
if value, ok := flagValues["namePrefix"]; ok {
query_namePrefix, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.NamePrefix(query_namePrefix)
}
if value, ok := flagValues["pageSize"]; ok {
query_pageSize, err := commands_util.ConvertValue_int64(value)
if err != nil {
return err
}
call.PageSize(query_pageSize)
}
if value, ok := flagValues["pageToken"]; ok {
query_pageToken, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.PageToken(query_pageToken)
}
if value, ok := flagValues["projectId"]; ok {
query_projectId, err := commands_util.ConvertValue_string(value)
if err != nil {
return err
}
call.ProjectId(query_projectId)
}
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
//.........这里部分代码省略.........
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:101,代码来源:genomics_v1alpha2.go
示例17: Runtimeconfig_v1beta1_ProjectsConfigsWaitersDelete
func Runtimeconfig_v1beta1_ProjectsConfigsWaitersDelete(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("projectsId"))
pathParams = append(pathParams, commands_util.AngrySnakes("configsId"))
pathParams = append(pathParams, commands_util.AngrySnakes("waitersId"))
if len(pathParams) != 0 {
if strings.Contains("v1beta1/projects/{projectsId}/configs/{configsId}/waiters/{waitersId}", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewProjectsConfigsWaitersService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"projectsId",
"configsId",
"waitersId",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_projectsId, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_configsId, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
param_waitersId, err := commands_util.ConvertValue_string(paramValues[2])
if err != nil {
return err
}
call := service.Delete(param_projectsId, param_configsId, param_waitersId)
response, err := call.Do()
if err != nil {
return err
}
err = commands_util.PrintResponse(response)
if err != nil {
return err
}
return nil
}
开发者ID:skelterjohn,项目名称:gcloud_apis,代码行数:70,代码来源:runtimeconfig_v1beta1.go
示例18: Sql_v1beta3_InstancesPromoteReplica
func Sql_v1beta3_InstancesPromoteReplica(context Context, args ...string) error {
usageFunc := func() {
usageBits := fmt.Sprintf("gcloud_apis %s", context.InvocationMethod)
var pathParams []string
pathParams = append(pathParams, commands_util.AngrySnakes("project"))
pathParams = append(pathParams, commands_util.AngrySnakes("instance"))
if len(pathParams) != 0 {
if strings.Contains("projects/{project}/instances/{instance}/promoteReplica", "+") {
usageBits += " @" + strings.Join(pathParams, "@")
} else {
usageBits += " " + strings.Join(pathParams, "/")
}
}
fmt.Fprintf(os.Stderr, "Usage:\n\t%s\n", usageBits)
os.Exit(1)
}
api_service, err := api_client.New(context.Client)
if err != nil {
return err
}
service := api_client.NewInstancesService(api_service)
// Only positional arguments should remain in args.
if len(args) != 1 {
usageFunc()
}
expectedParams := []string{
"project",
"instance",
}
paramValues := commands_util.SplitParamValues(args[0])
if len(paramValues) != len(expectedParams) {
return commands_util.ErrForWrongParams(expectedParams, paramValues, args)
}
param_project, err := commands_util.ConvertValue_string(paramValues[0])
if err != nil {
return err
}
param_instance, err := commands_util.ConvertValue_string(paramValues[1])
if err != nil {
return err
}
call := service.PromoteReplica(param_project, pa
|
请发表评论