Exemplo n.º 1
0
    def delete_pca(self, pca):
        """Deletes a PCA.

        """
        check_resource_type(pca, PCA_PATH, message="A PCA id is needed.")
        pca_id = get_pca_id(pca)
        if pca_id:
            return self._delete("%s%s" % (self.url, pca_id))
Exemplo n.º 2
0
    def update_pca(self, pca, changes):
        """Updates a PCA.

        """
        check_resource_type(pca, PCA_PATH, message="A PCA id is needed.")
        pca_id = get_pca_id(pca)
        if pca_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, pca_id), body)
Exemplo n.º 3
0
    def delete_pca(self, pca):
        """Deletes a PCA.

        """
        check_resource_type(pca, PCA_PATH,
                            message="A PCA id is needed.")
        pca_id = get_pca_id(pca)
        if pca_id:
            return self._delete("%s%s" % (self.url, pca_id))
Exemplo n.º 4
0
    def update_pca(self, pca, changes):
        """Updates a PCA.

        """
        check_resource_type(pca, PCA_PATH,
                            message="A PCA id is needed.")
        pca_id = get_pca_id(pca)
        if pca_id:
            body = json.dumps(changes)
            return self._update(
                "%s%s" % (self.url, pca_id), body)
Exemplo n.º 5
0
    def get_pca(self, pca, query_string='',
                shared_username=None, shared_api_key=None):
        """Retrieves a PCA.

           The model parameter should be a string containing the
           PCA id or the dict returned by create_pca.
           As a PCA is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state, the function will
           return a dict that encloses the PCA
           values and state info available at the time it is called.

           If this is a shared PCA, the username and
           sharing api key must also be provided.
        """
        check_resource_type(pca, PCA_PATH,
                            message="A PCA id is needed.")
        pca_id = get_pca_id(pca)
        if pca_id:
            return self._get("%s%s" % (self.url, pca_id),
                             query_string=query_string,
                             shared_username=shared_username,
                             shared_api_key=shared_api_key)