def AddCertificateAuthorityIssuancePolicyFlag(parser): base.Argument( '--issuance-policy', action='store', type=arg_parsers.YAMLFileContents(), help=("A YAML file describing this Certificate Authority's issuance " 'policy.')).AddToParser(parser)
def AddFileArg(parser): """Adds a FILE positional arg.""" parser.add_argument( 'FILE', type=arg_parsers.YAMLFileContents(), help='The absolute path to the YAML file with an application ' 'definition to update or deploy.')
def Args(parser): # Flags specific to managed CR managed_group = flags.GetManagedArgGroup(parser) flags.AddRegionArg(managed_group) # Flags specific to CRoGKE gke_group = flags.GetGkeArgGroup(parser) concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION ]).AddToParser(gke_group) # Flags specific to connecting to a Kubernetes cluster (kubeconfig) kubernetes_group = flags.GetKubernetesArgGroup(parser) flags.AddKubeconfigFlags(kubernetes_group) # Flags specific to connecting to a cluster cluster_group = flags.GetClusterArgGroup(parser) namespace_presentation = presentation_specs.ResourcePresentationSpec( '--namespace', resource_args.GetNamespaceResourceSpec(), 'Namespace to replace service.', required=True, prefixes=False) concept_parsers.ConceptParser( [namespace_presentation]).AddToParser(cluster_group) # Flags not specific to any platform flags.AddAsyncFlag(parser) flags.AddPlatformArg(parser) parser.add_argument( 'FILE', action='store', type=arg_parsers.YAMLFileContents(), help='The absolute path to the YAML file with a Knative ' 'service definition for the service to update or deploy.')
def Args(parser): flags.AddLocationResourceArg(parser, 'Location to import taxonomies to.') parser.add_argument( 'taxonomies', type=arg_parsers.YAMLFileContents(), metavar='TAXONOMIES', help="""\ File containing serialized taxonomy. """)
def AddPredefinedValuesFileFlag(parser): """Adds a flag for the predefined x509 extensions file for a Certificate Template.""" base.Argument( '--predefined-values-file', action='store', type=arg_parsers.YAMLFileContents(), help=('A YAML file describing any predefined X.509 values set by this ' 'template. The provided extensions will be copied over to any ' 'certificate requests that use this template, taking precedent ' 'over any allowed extensions in the certificate request.' )).AddToParser(parser)
def AddServiceYamlPositionalArg(self): self._AddFlag( 'service_config', metavar='SERVICE_CONFIG', nargs='?', type=arg_parsers.YAMLFileContents(), help=( 'service.yaml filename override. Defaults to the first file ' 'matching ```*service.dev.yaml``` then ```*service.yaml```, if any ' 'exist.' ), )
def Args(parser): # Flags specific to connecting to a cluster cluster_group = flags.GetClusterArgGroup(parser) namespace_presentation = presentation_specs.ResourcePresentationSpec( '--namespace', resource_args.GetNamespaceResourceSpec(), 'Namespace to replace service.', required=True, prefixes=False) concept_parsers.ConceptParser([namespace_presentation ]).AddToParser(cluster_group) # Flags not specific to any platform flags.AddAsyncFlag(parser) parser.add_argument( 'FILE', action='store', type=arg_parsers.YAMLFileContents(), help='The absolute path to the YAML file with a Knative ' 'service definition for the service to update or deploy.')
def AddParametersFlags(parser): """Adds parameters and parameters-from-file flags.""" parameters_group = parser.add_mutually_exclusive_group() parameters_group.add_argument( '--{}'.format(_PARAMETERS_FLAG_NAME), type=arg_parsers.ArgDict(), action=arg_parsers.UpdateAction, default={}, help='Comma-separated list of parameter names and values. ' 'Names must be one of the parameters shown when describing the ' 'event type. Only simple values can be specified with this flag. ' 'To specify more complex types like lists and nested objects, ' 'use --{}-from-file.'.format(_PARAMETERS_FLAG_NAME), metavar='PARAMETER=VALUE') parameters_group.add_argument( '--{}-from-file'.format(_PARAMETERS_FLAG_NAME), type=arg_parsers.YAMLFileContents(validator=yaml.dict_like), default={}, help='Path to a local JSON or YAML file that defines a dictionary of ' 'parameters and their values. Parameters must match the items shown when ' 'describing the event type.')