Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 67 additions & 67 deletions bigtable/google/cloud/bigtable_admin_v2/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,73 +33,6 @@ class StorageType(enum.IntEnum):
HDD = 2


class Instance(object):
class State(enum.IntEnum):
"""
Possible states of an instance.

Attributes:
STATE_NOT_KNOWN (int): The state of the instance could not be determined.
READY (int): The instance has been successfully created and can serve requests
to its tables.
CREATING (int): The instance is currently being created, and may be destroyed
if the creation process encounters an error.
"""

STATE_NOT_KNOWN = 0
READY = 1
CREATING = 2

class Type(enum.IntEnum):
"""
The type of the instance.

Attributes:
TYPE_UNSPECIFIED (int): The type of the instance is unspecified. If set when creating an
instance, a ``PRODUCTION`` instance will be created. If set when
updating an instance, the type will be left unchanged.
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on the
cluster.
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it has
no performance or uptime guarantees and is not covered by SLA. After a
development instance is created, it can be upgraded by updating the
instance to type ``PRODUCTION``. An instance created as a production
instance cannot be changed to a development instance. When creating a
development instance, ``serve_nodes`` on the cluster must not be set.
"""

TYPE_UNSPECIFIED = 0
PRODUCTION = 1
DEVELOPMENT = 2


class Cluster(object):
class State(enum.IntEnum):
"""
Possible states of a cluster.

Attributes:
STATE_NOT_KNOWN (int): The state of the cluster could not be determined.
READY (int): The cluster has been successfully created and is ready to serve requests.
CREATING (int): The cluster is currently being created, and may be destroyed
if the creation process encounters an error.
A cluster may not be able to serve requests while being created.
RESIZING (int): The cluster is currently being resized, and may revert to its previous
node count if the process encounters an error.
A cluster is still capable of serving requests while being resized,
but may exhibit performance as if its number of allocated nodes is
between the starting and requested states.
DISABLED (int): The cluster has no backing nodes. The data (tables) still
exist, but no operations can be performed on the cluster.
"""

STATE_NOT_KNOWN = 0
READY = 1
CREATING = 2
RESIZING = 3
DISABLED = 4


class Table(object):
class TimestampGranularity(enum.IntEnum):
"""
Expand Down Expand Up @@ -176,3 +109,70 @@ class State(enum.IntEnum):
STATE_NOT_KNOWN = 0
READY = 1
CREATING = 2


class Instance(object):
class State(enum.IntEnum):
"""
Possible states of an instance.

Attributes:
STATE_NOT_KNOWN (int): The state of the instance could not be determined.
READY (int): The instance has been successfully created and can serve requests
to its tables.
CREATING (int): The instance is currently being created, and may be destroyed
if the creation process encounters an error.
"""

STATE_NOT_KNOWN = 0
READY = 1
CREATING = 2

class Type(enum.IntEnum):
"""
The type of the instance.

Attributes:
TYPE_UNSPECIFIED (int): The type of the instance is unspecified. If set when creating an
instance, a ``PRODUCTION`` instance will be created. If set when
updating an instance, the type will be left unchanged.
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on the
cluster.
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it has
no performance or uptime guarantees and is not covered by SLA. After a
development instance is created, it can be upgraded by updating the
instance to type ``PRODUCTION``. An instance created as a production
instance cannot be changed to a development instance. When creating a
development instance, ``serve_nodes`` on the cluster must not be set.
"""

TYPE_UNSPECIFIED = 0
PRODUCTION = 1
DEVELOPMENT = 2


class Cluster(object):
class State(enum.IntEnum):
"""
Possible states of a cluster.

Attributes:
STATE_NOT_KNOWN (int): The state of the cluster could not be determined.
READY (int): The cluster has been successfully created and is ready to serve requests.
CREATING (int): The cluster is currently being created, and may be destroyed
if the creation process encounters an error.
A cluster may not be able to serve requests while being created.
RESIZING (int): The cluster is currently being resized, and may revert to its previous
node count if the process encounters an error.
A cluster is still capable of serving requests while being resized,
but may exhibit performance as if its number of allocated nodes is
between the starting and requested states.
DISABLED (int): The cluster has no backing nodes. The data (tables) still
exist, but no operations can be performed on the cluster.
"""

STATE_NOT_KNOWN = 0
READY = 1
CREATING = 2
RESIZING = 3
DISABLED = 4
Comment thread
tseaver marked this conversation as resolved.
28 changes: 12 additions & 16 deletions bigtable/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,36 @@
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))

@nox.session(python="3.7")
def blacken(session):
"""Run black.
def lint(session):
"""Run linters.

Format code to uniform standard.
Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
"""
session.install("black")
session.install("flake8", "black", *LOCAL_DEPS)
session.run(
"black",
"--check",
"google",
"tests",
"docs",
"--exclude",
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
)
session.run("flake8", "google", "tests")


@nox.session(python="3.7")
def lint(session):
"""Run linters.
@nox.session(python="3.6")
def blacken(session):
"""Run black.

Returns a failure if the linters find linting errors or sufficiently
serious code quality issues.
Format code to uniform standard.
"""
session.install("flake8", "black", *LOCAL_DEPS)
session.install("black")
session.run(
"black",
"--check",
"google",
"tests",
"docs",
"--exclude",
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
)
session.run("flake8", "google", "tests")
Comment thread
tseaver marked this conversation as resolved.


@nox.session(python="3.7")
Expand Down
49 changes: 49 additions & 0 deletions bigtable/synth.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"updateTime": "2018-12-08T13:13:19.537274Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.2",
"dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "6f6505a69b2b0a1260c93e890d636eefb859e76e",
"internalRef": "224530961"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2018.12.6"
}
}
],
"destinations": [
{
"client": {
"source": "googleapis",
"apiName": "bigtable",
"apiVersion": "v2",
"language": "python",
"generator": "gapic",
"config": "google/bigtable/artman_bigtable.yaml"
}
},
{
"client": {
"source": "googleapis",
"apiName": "bigtable_admin",
"apiVersion": "v2",
"language": "python",
"generator": "gapic",
"config": "google/bigtable/admin/artman_bigtableadmin.yaml"
}
}
]
}