Change in ovirt-engine[master]: restapi: External host provider

juan.hernandez at redhat.com juan.hernandez at redhat.com
Tue Oct 28 14:06:19 UTC 2014


Juan Hernandez has submitted this change and it was merged.

Change subject: restapi: External host provider
......................................................................


restapi: External host provider

This patch adds the resources for the external host providers. The
representation of the resource will look like this:

  GET /externalhostproviders
  <external_host_providers>
    <external_host_provider id="{provider:id}">...</external_host_provider>
    ...
  </external_host_providers>

  GET /externalhostproviders/{provider:id}
  <external_host_provider id="{provider:id}">
    <name>myprovider</name>
    <description>My provider</description>
    <url>http://provider.example.com</url>
    <requires_authentication>true</requires_authentication>
    <username>myuser</username>
    <password>mypass</password>
  </external_host_provider>

The providers collection will support listing, getting, adding, and removing
providers, with the usual methods.

The provider resource will support getting, deleting and updating the provider,
with the usual methods. In addition it will support the "testconnectivity" and
"importcertificates" operation. The first is used to check the connectivity
with the external provider:

  POST /externalhostproviders/{provider:id}/testconnectivity
  <action/>

The second is used to import the chain of certificates of the external
provider:

  POST /externalhostproviders/{provider:id}/importcertificates
  <action/>

The provider resource includes subcollections for certificates, provisioned
hosts, discovered hosts, host groups and compute resources, all of them read
only. For certificates it will look like this:

  GET /externalhostproviders/{provider:id}/certificates
  <certificates>
    <certificate id="{host:id}">...</certificate>
    ...
  </fcertificates>

  GET /externalhostproviders/{provider:id}/certificates/{certificate:id}
  <certificate id="{certificate:id}">
    <subject>CN=provider.example.com</subject>
    <content>...</content>
  </certificate>

For provisioned hosts:

  GET /externalhostproviders/{provider:id}/hosts
  <external_hosts>
    <external_host id="{host:id}">...</external_host>
    ...
  </external_hosts>

  GET /externalhostproviders/{provider:id}/hosts/{host:id}
  <external_host id="{host:id}">
    <name>myhost</name>
    <address>mhost.example.com</address>
  </external_host>

For discovered hosts:

  GET /externalhostproviders/{provider:id}/discoveredhosts
  <external_discovered_hosts>
    <external_discovered_host id="{host:id}">...</external_discovered_host>
    ...
  </external_discovered_hosts>

  GET /externalhostproviders/{provider:id}/discoveredhosts/{discoveredhost:id}
  <external_discovered_host id="{discoveredhost:id}">
    <name>myhost</name>
    <ip>192.168.122.23</ip>
    <mac>52:54:00:1a:65:40</mac>
    <subnet_name>...</subnet_name>
    <last_report>...</last_report>
  </external_discovered_host>

For host groups:

  GET /externalhostproviders/{provider:id}/hostgroups
  <external_host_groups>
    <external_host_group id="{group:id}">...</external_host_group>
    ...
  </external_host_groups>

  GET /externalhostproviders/{provider:id}/hostgroups/{group:id}
  <external_host_group id="{group:id}">
    <name>mygroup</name>
    <architecture_name>...</architecture_name>
    <operating_system_name>...</operating_system_name>
    <subnet_name>...</subnet_name>
    <domain_name>...</domain_name>
  </external_host_group>

For compute resources:

  GET /externalhostproviders/{provider:id}/computeresources
  <external_compute_resources>
    <external_compute_resource id="{resource:id}">...</external_compute_resource>
    ...
  </external_compute_resources>

  GET /externalhostproviders/{provider:id}/computeresources/{resource:id}
  <external_compute_resource id="{resource:id}">
    <name>myresource</name>
    <provider>...</provider>
    <user>...</user>
    <url>...</url>
  </external_compute_resource>

Change-Id: I2144125f00822263dc68da881eb3180c4cd6b237
Related-To: https://bugzilla.redhat.com/1132259
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalComputeResourceResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalComputeResourcesResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalDiscoveredHostResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalDiscoveredHostsResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostGroupResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostGroupsResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostProviderResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostProvidersResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/externalhostproviders/ExternalHostsResource.java
M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/ApiRootLinksCreator.java
M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/utils/LinkHelper.java
M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BaseBackendResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalComputeResourceResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalComputeResourcesResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalDiscoveredHostResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalDiscoveredHostsResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostGroupResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostGroupsResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostProviderResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostProvidersResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostsResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java
M backend/manager/modules/restapi/jaxrs/src/main/resources/org/ovirt/engine/api/restapi/logging/Messages.properties
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendApiResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalComputeResourceResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalComputeResourcesResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalDiscoveredHostResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalDiscoveredHostsResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostGroupResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostGroupsResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostProviderResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostProvidersResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/externalhostproviders/BackendExternalHostsResourceTest.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalComputeResourceMapper.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalDiscoveredHostMapper.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostGroupMapper.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostMapper.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostProviderMapper.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalComputeResourceMapperTest.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalDiscoveredHostMapperTest.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostGroupMapperTest.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostMapperTest.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/externalhostproviders/ExternalHostProviderMapperTest.java
49 files changed, 3,372 insertions(+), 7 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/33969
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2144125f00822263dc68da881eb3180c4cd6b237
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list