1- help_text: 2 brief: Create a Cloud Scheduler job that triggers an action via HTTP. 3 description: Create a Cloud Scheduler job that triggers an action via HTTP. 4 examples: | 5 The following command creates a job that sends a HTTP GET request to 6 'http://example.com/path' every 3 hours: 7 8 $ {command} my-job --schedule="0 */3 * * *" 9 --uri="http://example.com/path" --http-method=GET 10 11 request: 12 collection: cloudscheduler.projects.locations.jobs 13 method: create 14 modify_request_hooks: 15 - googlecloudsdk.command_lib.scheduler.util:ModifyCreateJobRequest 16 17 arguments: 18 resource: 19 help_text: Job to create. 20 spec: !REF googlecloudsdk.command_lib.scheduler.resources:job 21 removed_flags: [location] 22 params: 23 - _REF_: googlecloudsdk.command_lib.scheduler.flags:schedule 24 required: true 25 - _REF_: googlecloudsdk.command_lib.scheduler.flags:timezone 26 - _REF_: googlecloudsdk.command_lib.scheduler.flags:description 27 - _REF_: googlecloudsdk.command_lib.scheduler.flags:attempt_deadline 28 - _REF_: googlecloudsdk.command_lib.scheduler.flags:retry_attempts 29 - _REF_: googlecloudsdk.command_lib.scheduler.flags:retry_duration 30 - _REF_: googlecloudsdk.command_lib.scheduler.flags:min_backoff 31 - _REF_: googlecloudsdk.command_lib.scheduler.flags:max_backoff 32 - _REF_: googlecloudsdk.command_lib.scheduler.flags:max_doublings 33 - api_field: job.httpTarget.uri 34 arg_name: uri 35 required: true 36 # Can't use : in argument hooks so omit it both from regex and help 37 # message. 38 type: 39 googlecloudsdk.calliope.arg_parsers:RegexpValidator:pattern=^https?.//.*,description=Must 40 be a valid HTTP or HTTPS URL. 41 help_text: | 42 The full URI path that the request will be sent to. This string must 43 begin with either "http://" or "https://". For example, 44 `http://acme.com` or `https://acme.com/sales:8080`. Cloud Scheduler will 45 encode some characters for safety and compatibility. The maximum allowed 46 URL length is 2083 characters after encoding. 47 - api_field: job.httpTarget.httpMethod 48 arg_name: http-method 49 default: post 50 choices: 51 - arg_value: post 52 enum_value: POST 53 - arg_value: head 54 enum_value: HEAD 55 - arg_value: get 56 enum_value: GET 57 - arg_value: put 58 enum_value: PUT 59 - arg_value: delete 60 enum_value: DELETE 61 help_text: | 62 HTTP method to use for the request. 63 - api_field: job.httpTarget.headers.additionalProperties 64 arg_name: headers 65 type: 66 arg_dict: 67 flatten: true 68 spec: 69 - api_field: key 70 - api_field: value 71 help_text: | 72 KEY=VALUE pairs of HTTP headers to include in the request. 73 *Cannot be repeated*. For example: 74 `--headers Accept-Language=en-us,Accept=text/plain` 75 - group: 76 mutex: true 77 params: 78 - api_field: job.httpTarget.body 79 arg_name: message-body 80 help_text: | 81 Data payload to be included as the body of the HTTP 82 request. May only be given with compatible HTTP methods (PUT 83 or POST). 84 - api_field: job.httpTarget.body 85 arg_name: message-body-from-file 86 type: 87 googlecloudsdk.calliope.arg_parsers:FileContents:binary=True 88 help_text: | 89 Path to file containing the data payload to be included as the 90 body of the HTTP request. May only be given with compatible HTTP 91 methods (PUT or POST). 92 - group: 93 help_text: | 94 How the request sent to the target when executing the job should be 95 authenticated. 96 mutex: true 97 params: 98 - _REF_: googlecloudsdk.command_lib.scheduler.flags:auth_token_openid 99 - _REF_: googlecloudsdk.command_lib.scheduler.flags:auth_token_oauth 100