def get_scenarios(self, namespaces="", labels=None, selector=None):
        """
            https://github.com/kubernetes-incubator/client-python/blob/master/kubernetes/docs/
            ExtensionsV1beta1Api.md#list_namespaced_deployment
        """
        try:
            crds = self.client_extensionsApi.list_custom_resource_definition().to_dict()['items']
            crd = None
            for x in crds:
                if x['spec']['names']['plural'].lower() == K8S_CRD_PLURAL and \
                        x['spec']['group'].lower() == K8S_CRD_GROUP:
                    crd = x
            if crd == None:
                return []

            scenarios = self.client_customObjectsApi.list_namespaced_custom_object(
                K8S_CRD_GROUP,
                K8S_CRD_VERSION,
                namespaces,
                K8S_CRD_PLURAL)
            out = []
            for scenario in scenarios['items']:
                out.append(scenario['spec'])
            self.logger.debug("Read %d scenarios from CRDS", len(out))
            return out
        except ApiException as e:
            if e.status == 403:
                self.logger.info("No permission to list powerfulseal CRDs. Ignoring.")
                return []
            self.logger.exception(e)
            raise

            https://github.com/kubernetes-incubator/client-python/blob/master/kubernetes/docs/
            ExtensionsV1beta1Api.md#list_namespaced_deployment
        
powerfulseal/k8s/k8s_client.py