Пример #1
0
def ParseReplaceServicePerimetersResponseBase(lro, version):
    """Parse the Long Running Operation response of the ReplaceServicePerimeters call.

  Args:
    lro: Long Running Operation response of ReplaceServicePerimeters.
    version: version of the API. e.g. 'v1beta', 'v1'.

  Returns:
    The replacement Service Perimeters created by the ReplaceServicePerimeters
    call.

  Raises:
    ParseResponseError: if the response could not be parsed into the proper
    object.
  """
    client = util.GetClient(version=version)
    operation_ref = resources.REGISTRY.Parse(
        lro.name, collection='accesscontextmanager.operations')
    poller = common.BulkAPIOperationPoller(
        client.accessPolicies_servicePerimeters, client.operations,
        operation_ref)

    return waiter.WaitFor(
        poller, operation_ref,
        'Waiting for Replace Service Perimeters operation [{}]'.format(
            operation_ref.Name()))
Пример #2
0
    def VersionedParseReplaceAccessLevelsResponse(lro, unused_args):
        """Parse the Long Running Operation response of the ReplaceAccessLevels call.

    Args:
      lro: Long Running Operation response of ReplaceAccessLevels.
      unused_args: not used.

    Returns:
      The replacement Access Levels created by the ReplaceAccessLevels call.

    Raises:
      ParseResponseError: if the response could not be parsed into the proper
      object.
    """
        client = util.GetClient(version=api_version)
        operation_ref = resources.REGISTRY.Parse(
            lro.name, collection='accesscontextmanager.operations')
        poller = common.BulkAPIOperationPoller(
            client.accessPolicies_accessLevels, client.operations,
            operation_ref)

        return waiter.WaitFor(
            poller, operation_ref,
            'Waiting for Replace Access Levels operation [{}]'.format(
                operation_ref.Name()))