diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-08-27 14:19:39 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-08-27 14:19:39 +0200 |
commit | 4615ca63b9b5bb08e11b50cb07d57b5610e9aaf9 (patch) | |
tree | 8952532047f93334827703b50aa067811194830a /python | |
parent | 657ccdfad595192340758093a1eef0aab4c12310 (diff) |
Add method to delete a deployment
Diffstat (limited to 'python')
-rw-r--r-- | python/vespa/vespa/package.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/vespa/vespa/package.py b/python/vespa/vespa/package.py index 3deb4ec8c50..4312380dcfe 100644 --- a/python/vespa/vespa/package.py +++ b/python/vespa/vespa/package.py @@ -630,7 +630,6 @@ class VespaCloud(object): :return: a Vespa connection instance. """ - region = self.get_dev_region() job = 'dev-' + region run = self.start_deployment(instance, job, application_package) @@ -638,6 +637,15 @@ class VespaCloud(object): endpoint_url = self.get_endpoint(instance, region) return Vespa(url = endpoint_url, cert = self.data_cert_file.name) + def delete(self, instance: str): + """ + Delete the specified instance from the dev environment in the Vespa Cloud. + :param instance: Name of the instance to delete. + :return: + """ + print(self.request('DELETE', '/application/v4/tenant/{}/application/{}/instance/{}/environment/dev/region/{}' \ + .format(self.tenant, self.application, instance, self.get_dev_region()))['message']) + def close(self): self.connection.close() self.data_cert_file.close() |