예제 #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
파일: app.py 프로젝트: richdost/predixpy
    def create_blobstore(self):
        """
        Creates an instance of the BlobStore Service.
        """
        blobstore = predix.admin.blobstore.BlobStore()
        blobstore.create()

        blobstore.add_to_manifest(self)
        return blobstore