Delete an instance.

    TODO: docstring
435492
def delete_instance(credentials, project, zone, name, wait_until_done=False):
    

    access_token = credentials.get_access_token()

    headers = {
        'Authorization': 'Bearer %s' % access_token.access_token
    }

    r = requests.delete('https://www.googleapis.com/compute/v1/'
                        'projects/%s/zones/%s/instances/%s'
                        % (project, zone, name),
                        headers=headers)

    r.raise_for_status()

    op_name = r.json()['name']

    _LOGGER.info('Submitted request to create intsance '
                '(HTTP code: %d).',
                r.status_code)

    if wait_until_done:
        _LOGGER.info('Waiting until operation is done...')
        wait_for_zone_op(access_token, project, zone, op_name)

    return op_name
677838
def delete(self):
        """"""
        self._client.remove_object(self._instance, self._bucket, self.name)
682639
def destroy(bulk=false)
      caught = catch(:halt)  do
        _run_destroy_callbacks do
          result = database.delete_doc(self, bulk)
          if result['ok']
            self.delete('_rev')
            self.delete('_id')
          end
          result['ok']
        end
      end
    end
218459
def c_delete(api, args, verbose=False):
    
    obj = api.get_object(args['<URL>'].split('/')[-1])
    obj.delete()
    if verbose:
        return ['deleted object at', api.url(obj)]
1150736
def del_object(self, obj):
        """"""
        if obj['_index'] is None or obj['_index'] == "":
            raise Exception("Invalid Object")
        if obj['_id'] is None or obj['_id'] == "":
            raise Exception("Invalid Object")
        if obj['_type'] is None or obj['_type'] == "":
            raise Exception("Invalid Object")
        self.connect_es()
        self.es.delete(index=obj['_index'],
                       id=obj['_id'],
                       doc_type=obj['_type'])
223802
def delete(self, index, doc_type, id, bulk=False, **query_params):
        
        if bulk:
            cmd = {"delete": {"_index": index, "_type": doc_type,
                              "_id": id}}
            self.bulker.add(json.dumps(cmd, cls=self.encoder))
            return self.flush_bulk()

        path = make_path(index, doc_type, id)
        return self._send_request('DELETE', path, params=query_params)
1143508
def delete(self, **params):
        
        self.clear()
        self._context = None
        self._set_value(self._default_value())
        self.bucket._client.delete(self, **params)
        return self
183703
def delete(self, instance, acl):
        
        base_url = self._url.format(instance=instance)
        url = '{base}{aclid}/'.format(base=base_url, aclid=acl)
        response = requests.delete(url, **self._default_request_kwargs)

        if response.status_code == 200:
            logger.info('Successfully deleted ACL {}'.format(acl))
        else:
            logger.info('Failed to delete ACL {}'.format(acl))
            logger.info('Response: [{0}] {1}'.format(response.status_code, response.content))
            raise errors.ObjectRocketException('Failed to delete ACL.')
1018720
def remove(cls, id):
        

        api = Client.instance().api
        api.index(id).delete()
1228211
function destroy(publicAPI, model = {}) {
  const previousDestroy = publicAPI.destroy;

  if (!model.subscriptions) {
    model.subscriptions = [];
  }

  publicAPI.destroy = () => {
    if (previousDestroy) {
      previousDestroy();
    }
    while (model.subscriptions && model.subscriptions.length) {
      model.subscriptions.pop().unsubscribe();
    }
    Object.keys(model).forEach((field) => {
      delete model[field];
    });

    // Flag the instance beeing deleted
    model.deleted = true;
  };
}
419944
def remove(cls, name):
        

        api = Client.instance().api

        api.collection(name).delete()
927762
function destroyInstance (instanceId) {
  var instance = instanceOptions[instanceId];
  if (instance && instance.app instanceof instance.Vue) {
    try {
      instance.app.$destroy();
      instance.document.destroy();
    } catch (e) {}
    delete instance.document;
    delete instance.app;
  }
  delete instanceOptions[instanceId];
}
351322
def delete(cls, object_version, key=None):
        
        with db.session.begin_nested():
            q = cls.query.filter_by(
                version_id=as_object_version_id(object_version))
            if key:
                q = q.filter_by(key=key)
            q.delete()
11131
public static void deleteInstanceResources( Instance instance )	throws IOException {
		File dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
		Utils.deleteFilesRecursively( dir );
	}
874699
def delete(self, instance):
        
        
        #TODO: Really drop the database based on a policy set in `instance.parameters`.
        #
        #      We need :
        #      - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop    => default to retain)
        #      - to check that the database name `instance.get_dbname()` is not in use by another instance (shared database)
        #      - credential on the Atlas cluster `instance.get_cluster()` to drop the database
        #
        
        self.backend.storage.remove(instance)
        
        return DeprovisionServiceSpec(False, "done")
174405
def delete(self):
        
        with rconnect() as conn:
            # Can't delete an object without an ID.
            if self.id is None:
                raise FrinkError("You can't delete an object with no ID")
            else:
                if isinstance(self.id, uuid.UUID):
                    self.id = str(self.id)

                try:
                    query = r.db(
                        self._db
                    ).table(
                        self._table
                    ).get(
                        self.id
                    ).delete()
                    log.debug(query)
                    rv = query.run(conn)
                except Exception as e:
                    log.warn(e)
                    raise
                else:
                    return True
373420
def delete(self, doc_id: str) -> bool:
        """"""

        try:
            self.instance.delete(self.index, self.doc_type, doc_id)
        except RequestError as ex:
            logging.error(ex)
            return False
        else:
            return True