Пример #1
0
    def __init__(self, endpoint=None, **kwargs):
        endpoint, self.version = utils.endpoint_version_from_url(endpoint, 2.0)
        self.http_client = http.get_http_client(endpoint=endpoint, **kwargs)
        self.schemas = schemas.Controller(self.http_client)

        self.images = images.Controller(self.http_client, self.schemas)
        self.image_tags = image_tags.Controller(self.http_client, self.schemas)
        self.image_members = image_members.Controller(self.http_client,
                                                      self.schemas)

        self.tasks = tasks.Controller(self.http_client, self.schemas)

        self.metadefs_resource_type = (metadefs.ResourceTypeController(
            self.http_client, self.schemas))

        self.metadefs_property = (metadefs.PropertyController(
            self.http_client, self.schemas))

        self.metadefs_object = (metadefs.ObjectController(
            self.http_client, self.schemas))

        self.metadefs_tag = (metadefs.TagController(self.http_client,
                                                    self.schemas))

        self.metadefs_namespace = (metadefs.NamespaceController(
            self.http_client, self.schemas))

        self.versions = versions.VersionController(self.http_client)
Пример #2
0
    def __init__(self, endpoint, **kwargs):
        endpoint, version = utils.strip_version(endpoint)
        self.version = version or 2.0
        self.http_client = http.HTTPClient(endpoint, **kwargs)

        self.schemas = schemas.Controller(self.http_client)

        self.images = images.Controller(self.http_client, self.schemas)
        self.image_tags = image_tags.Controller(self.http_client, self.schemas)
        self.image_members = image_members.Controller(self.http_client,
                                                      self.schemas)

        self.tasks = tasks.Controller(self.http_client, self.schemas)

        self.metadefs_resource_type = (metadefs.ResourceTypeController(
            self.http_client, self.schemas))

        self.metadefs_property = (metadefs.PropertyController(
            self.http_client, self.schemas))

        self.metadefs_object = (metadefs.ObjectController(
            self.http_client, self.schemas))

        self.metadefs_namespace = (metadefs.NamespaceController(
            self.http_client, self.schemas))
Пример #3
0
 def __init__(self, *args, **kwargs):
     self.http_client = http.HTTPClient(*args, **kwargs)
     self.schemas = schemas.Controller(self.http_client)
     image_model = self._get_image_model()
     self.images = images.Controller(self.http_client, image_model)
     self.image_tags = image_tags.Controller(self.http_client, image_model)
     self.image_members = image_members.Controller(self.http_client,
                                                   self._get_member_model())
Пример #4
0
 def __init__(self, endpoint, *args, **kwargs):
     self.http_client = http.HTTPClient(utils.strip_version(endpoint),
                                        *args, **kwargs)
     self.schemas = schemas.Controller(self.http_client)
     image_model = self._get_image_model()
     self.images = images.Controller(self.http_client, image_model)
     self.image_tags = image_tags.Controller(self.http_client, image_model)
     self.image_members = image_members.Controller(self.http_client,
                                                   self._get_member_model())
Пример #5
0
    def __init__(self, client_info):
        endpoint = utils.strip_version(client_info['endpoint'])
        kwargs = {'cacert': client_info['cacert'],
                  'insecure': client_info['insecure'],
                  'token': client_info['token']}

        if isinstance(endpoint, tuple):
            endpoint = endpoint[0]
        self.http_client = http.HTTPClient(endpoint, **kwargs)
        self.schemas = schemas.Controller(self.http_client)
        self.images = images.Controller(self.http_client, self.schemas)
        self.image_tags = image_tags.Controller(self.http_client, self.schemas)
        self.image_members = image_members.Controller(self.http_client,
                                                      self.schemas)
Пример #6
0
 def setUp(self):
     super(TestController, self).setUp()
     self.api = utils.FakeAPI(fixtures)
     self.controller = image_members.Controller(self.api, FakeModel)
Пример #7
0
 def setUp(self):
     super(TestController, self).setUp()
     self.api = utils.FakeAPI(data_fixtures)
     self.schema_api = utils.FakeSchemaAPI(schema_fixtures)
     self.controller = image_members.Controller(self.api, self.schema_api)