コード例 #1
0
  def Run(self, args):
    """Create a Datastream route.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      A dict object representing the operations resource describing the create
      operation if the create was successful.
    """
    route_ref = args.CONCEPTS.route.Parse()
    parent_ref = route_ref.Parent().RelativeName()

    routes_client = routes.RoutesClient()
    result_operation = routes_client.Create(
        parent_ref, route_ref.routesId, args)

    client = util.GetClientInstance()
    messages = util.GetMessagesModule()
    resource_parser = util.GetResourceParser()

    operation_ref = resource_parser.Create(
        'datastream.projects.locations.operations',
        operationsId=result_operation.name,
        projectsId=route_ref.projectsId,
        locationsId=route_ref.locationsId)

    return client.projects_locations_operations.Get(
        messages.DatastreamProjectsLocationsOperationsGetRequest(
            name=operation_ref.operationsId))
コード例 #2
0
    def Run(self, args):
        """Update a Datastream connection profile.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      A dict object representing the operations resource describing the update
      operation if the update was successful.
    """
        connection_profile_ref = args.CONCEPTS.connection_profile.Parse()

        if args.oracle_prompt_for_password:
            args.oracle_password = console_io.PromptPassword(
                'Please Enter Password: '******'Please Enter Password: '******'datastream.projects.locations.operations',
            operationsId=result_operation.name,
            projectsId=connection_profile_ref.projectsId,
            locationsId=connection_profile_ref.locationsId)

        return client.projects_locations_operations.Get(
            messages.DatastreamProjectsLocationsOperationsGetRequest(
                name=operation_ref.operationsId))
コード例 #3
0
 def __init__(self, client=None, messages=None):
     self._client = client or util.GetClientInstance()
     self._messages = messages or util.GetMessagesModule()
     self._service = self._client.projects_locations_connectionProfiles
     self._resource_parser = util.GetResourceParser()