Beispiel #1
0
    def source_table(self):
        """The full name of the Table from which this Backup is created.

        .. note::
          This property will return None if ``table_id`` is not set.

        The table name is of the form

            ``"projects/../instances/../tables/{source_table}"``

        :rtype: str
        :returns: The Table name.
        """
        if not self._source_table and self.table_id:
            self._source_table = BigtableTableAdminClient.table_path(
                project=self._instance._client.project,
                instance=self._instance.instance_id,
                table=self.table_id,
            )
        return self._source_table
Beispiel #2
0
    def parent(self):
        """Name of the parent cluster used in requests.

        .. note::
          This property will return None if ``cluster`` is not set.

        The parent name is of the form

            ``"projects/{project}/instances/{instance_id}/clusters/{cluster}"``

        :rtype: str
        :returns: A full path to the parent cluster.
        """
        if not self._parent and self._cluster:
            self._parent = BigtableTableAdminClient.cluster_path(
                project=self._instance._client.project,
                instance=self._instance.instance_id,
                cluster=self._cluster,
            )
        return self._parent
Beispiel #3
0
    def name(self):
        """Backup name used in requests.

        The Backup name is of the form

            ``"projects/../instances/../clusters/../backups/{backup_id}"``

        :rtype: str
        :returns: The Backup name.

        :raises: ValueError: If the 'cluster' has not been set.
        """
        if not self._cluster:
            raise ValueError('"cluster" parameter must be set')

        return BigtableTableAdminClient.backup_path(
            project=self._instance._client.project,
            instance=self._instance.instance_id,
            cluster=self._cluster,
            backup=self.backup_id,
        )