Example #1
0
    def get_resources(self):
        resources = []

        instances = extensions.ResourceExtension('{tenant_id}/mgmt/instances',
                                                 MgmtInstanceController(),
                                                 member_actions={
                                                     'root': 'GET',
                                                     'diagnostics': 'GET',
                                                     'hwinfo': 'GET',
                                                     'rpc_ping': 'GET',
                                                     'action': 'POST'
                                                 })
        resources.append(instances)

        clusters = extensions.ResourceExtension(
            '{tenant_id}/mgmt/clusters',
            ClusterController(),
            member_actions={'action': 'POST'})
        resources.append(clusters)

        hosts = extensions.ResourceExtension('{tenant_id}/mgmt/hosts',
                                             HostController(),
                                             member_actions={})
        resources.append(hosts)

        quota = extensions.ResourceExtension('{tenant_id}/mgmt/quotas',
                                             QuotaController(),
                                             member_actions={})
        resources.append(quota)

        storage = extensions.ResourceExtension('{tenant_id}/mgmt/storage',
                                               StorageController(),
                                               member_actions={})
        resources.append(storage)

        host_instances = extensions.ResourceExtension(
            'instances',
            hostservice.HostInstanceController(),
            parent={
                'member_name': 'host',
                'collection_name': '{tenant_id}/mgmt/hosts'
            },
            collection_actions={'action': 'POST'})
        resources.append(host_instances)

        upgrade = extensions.ResourceExtension(
            '{tenant_id}/mgmt/instances/{instance_id}/upgrade',
            UpgradeController(),
            member_actions={})
        resources.append(upgrade)

        datastore_configuration_parameters = extensions.ResourceExtension(
            '{tenant_id}/mgmt/datastores/versions/{version_id}/parameters',
            conf_service.ConfigurationsParameterController(),
            member_actions={})
        resources.append(datastore_configuration_parameters)

        return resources
Example #2
0
    def get_resources(self):
        resources = []
        serializer = wsgi.TroveResponseSerializer(
            body_serializers={
                'application/xml': wsgi.TroveXMLDictSerializer()
            })
        instances = extensions.ResourceExtension(
            '{tenant_id}/mgmt/instances',
            MgmtInstanceController(),
            deserializer=wsgi.TroveRequestDeserializer(),
            serializer=serializer,
            member_actions={
                'root': 'GET',
                'diagnostics': 'GET',
                'hwinfo': 'GET',
                'action': 'POST'
            })
        resources.append(instances)

        hosts = extensions.ResourceExtension(
            '{tenant_id}/mgmt/hosts',
            HostController(),
            deserializer=wsgi.RequestDeserializer(),
            serializer=serializer,
            member_actions={})
        resources.append(hosts)

        quota = extensions.ResourceExtension(
            '{tenant_id}/mgmt/quotas',
            QuotaController(),
            deserializer=wsgi.RequestDeserializer(),
            serializer=serializer,
            member_actions={})
        resources.append(quota)

        storage = extensions.ResourceExtension(
            '{tenant_id}/mgmt/storage',
            StorageController(),
            deserializer=wsgi.RequestDeserializer(),
            serializer=serializer,
            member_actions={})
        resources.append(storage)

        host_instances = extensions.ResourceExtension(
            'instances',
            hostservice.HostInstanceController(),
            parent={
                'member_name': 'host',
                'collection_name': '{tenant_id}/mgmt/hosts'
            },
            deserializer=wsgi.RequestDeserializer(),
            serializer=serializer,
            collection_actions={'action': 'POST'})
        resources.append(host_instances)

        return resources
Example #3
0
    def get_resources(self):
        resources = []
        instances = extensions.ResourceExtension('{tenant_id}/mgmt/instances',
                                                 MgmtInstanceController(),
                                                 member_actions={
                                                     'root': 'GET',
                                                     'diagnostics': 'GET',
                                                     'hwinfo': 'GET',
                                                     'action': 'POST'
                                                 })
        resources.append(instances)

        hosts = extensions.ResourceExtension('{tenant_id}/mgmt/hosts',
                                             HostController(),
                                             member_actions={})
        resources.append(hosts)

        quota = extensions.ResourceExtension('{tenant_id}/mgmt/quotas',
                                             QuotaController(),
                                             member_actions={})
        resources.append(quota)

        storage = extensions.ResourceExtension('{tenant_id}/mgmt/storage',
                                               StorageController(),
                                               member_actions={})
        resources.append(storage)

        host_instances = extensions.ResourceExtension(
            'instances',
            hostservice.HostInstanceController(),
            parent={
                'member_name': 'host',
                'collection_name': '{tenant_id}/mgmt/hosts'
            },
            collection_actions={'action': 'POST'})
        resources.append(host_instances)

        return resources