def Args(parser): """Set up arguments for this command.""" AddSignedUrlKey.BACKEND_BUCKET_ARG = flags.BackendBucketArgument() AddSignedUrlKey.BACKEND_BUCKET_ARG.AddArgument( parser, operation_type='add CDN signed URL key to') signed_url_flags.AddCdnSignedUrlKeyName(parser, required=True) signed_url_flags.AddCdnSignedUrlKeyFile(parser, required=True)
def Args(parser): """Set up arguments for this command. Args: parser: An argparse.ArgumentParser. """ signed_url_flags.AddCdnSignedUrlKeyName(parser, required=True) signed_url_flags.AddCdnSignedUrlKeyFile(parser, required=True) parser.add_argument('--expires-in', type=arg_parsers.Duration(), required=True, help="""\ The duration for which the signed URL will be valid. For example, specifying `12h` will cause the signed URL to be valid up to 12 hours. See $ gcloud topic datetimes for information on duration formats. """) parser.add_argument('--validate', action='store_true', help="""\ If provided, validates the generated signed URL by sending a HEAD request and prints out the HTTP response code. If the signed URL is valid, the result should be the same as the response code sent by the backend. If it isn't, recheck the key name and the contents of the key file, and ensure that expires-in is set to at least several seconds and that the clock on the computer running this command is accurate. If not provided, the generated signed URL is not verified. """) parser.add_argument('url', help='The URL to sign.')
def Args(parser): """Set up arguments for this command.""" flags.GLOBAL_BACKEND_SERVICE_ARG.AddArgument(parser) signed_url_flags.AddCdnSignedUrlKeyName(parser, required=True)