Example #1
0
 def Args(cls, parser):
     """Set up arguments for this command."""
     parser.display_info.AddFormat(flags.DEFAULT_LIST_FORMAT)
     cls.EXTERNAL_VPN_GATEWAY_ARG = flags.ExternalVpnGatewayArgument()
     cls.EXTERNAL_VPN_GATEWAY_ARG.AddArgument(parser,
                                              operation_type='create')
     flags.AddCreateExternalVpnGatewayArgs(parser)
     parser.display_info.AddCacheUpdater(flags.ExternalVpnGatewaysCompleter)
Example #2
0
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Command to describe External VPN gateways."""

from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute.external_vpn_gateways import external_vpn_gateways_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.compute import flags as compute_flags
from googlecloudsdk.command_lib.compute.external_vpn_gateways import flags

_EXTERNAL_VPN_GATEWAY_ARG = flags.ExternalVpnGatewayArgument()


class Describe(base.DescribeCommand):
    """Describe a Google Compute Engine external VPN gateway.

  *{command}* is used to display all data associated with a Google Compute
  Engine external VPN gateway in a project.

  An external VPN gateway provides the information to Google Cloud Platform
  about your on-premises side or another Cloud provider's VPN gateway.
  """
    @staticmethod
    def Args(parser):
        _EXTERNAL_VPN_GATEWAY_ARG.AddArgument(parser,
                                              operation_type='describe')
Example #3
0
"""Command to update labels for external VPN gateway."""

from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute.external_vpn_gateways import external_vpn_gateways_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions as calliope_exceptions
from googlecloudsdk.command_lib.compute import flags as compute_flags
from googlecloudsdk.command_lib.compute.external_vpn_gateways import flags as external_vpn_gateway_flag
from googlecloudsdk.command_lib.util.args import labels_util

_EXTERNAL_VPN_GATEWAY_ARG = (
    external_vpn_gateway_flag.ExternalVpnGatewayArgument())


@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA)
class Update(base.UpdateCommand):
    r"""Update a Google Compute Engine external VPN gateway.

  *{command}* updates labels for a Google Compute Engine External VPN gateway.
  For example:

    $ {command} example-gateway \
      --update-labels=k0=value1,k1=value2 --remove-labels=k3

  will add/update labels ``k0'' and ``k1'' and remove labels with key ``k3''.

  Labels can be used to identify the External VPN gateway and to filter them