예제 #1
0
파일: app.py 프로젝트: richdost/predixpy
    def create_manifest_from_space(self):
        """
        Populate a manifest file generated from details from the
        cloud foundry space environment.
        """
        space = predix.admin.cf.spaces.Space()

        summary = space.get_space_summary()
        for instance in summary['services']:
            service_type = instance['service_plan']['service']['label']
            name = instance['name']
            if service_type == 'predix-uaa':
                uaa = predix.admin.uaa.UserAccountAuthentication(name=name)
                uaa.add_to_manifest(self)
            elif service_type == 'predix-acs':
                acs = predix.admin.acs.AccessControl(name=name)
                acs.add_to_manifest(self)
            elif service_type == 'predix-asset':
                asset = predix.admin.asset.Asset(name=name)
                asset.add_to_manifest(self)
            elif service_type == 'predix-timeseries':
                timeseries = predix.admin.timeseries.TimeSeries(name=name)
                timeseries.add_to_manifest(self)
            elif service_type == 'predix-blobstore':
                blobstore = predix.admin.blobstore.BlobStore(name=name)
                blobstore.add_to_manifest(self)
            elif service_type == 'us-weather-forecast':
                weather = predix.admin.weather.WeatherForecast(name=name)
                weather.add_to_manifest(self)
            else:
                logging.warn("Unsupported service type: %s" % service_type)
예제 #2
0
 def create_uaa(self, admin_secret):
     """
     Creates an instance of UAA Service.
     """
     import predix.admin.uaa
     uaa = predix.admin.uaa.UserAccountAuthentication()
     if not uaa.exists():
         uaa.create(admin_secret)
         uaa.add_to_manifest(self.manifest_path)
     return uaa
예제 #3
0
파일: app.py 프로젝트: richdost/predixpy
    def create_uaa(self, admin_secret):
        """
        Creates an instance of UAA Service.

        :param admin_secret: The secret password for administering the service
            such as adding clients and users.
        """
        uaa = predix.admin.uaa.UserAccountAuthentication()
        if not uaa.exists():
            uaa.create(admin_secret)
            uaa.add_to_manifest(self)
        return uaa