Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compute API 2.15 Microversion for server groups #1263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.openstack4j.openstack.compute.internal;

import org.openstack4j.api.types.ServiceType;
import org.openstack4j.openstack.internal.MicroVersion;
import org.openstack4j.openstack.internal.MicroVersionedOpenStackService;

class BaseMicroVersionedComputeServices extends MicroVersionedOpenStackService {

static MicroVersion MICRO_VERSION_2_15 = new MicroVersion(2, 15);

BaseMicroVersionedComputeServices(MicroVersion microVersion) {
super(ServiceType.COMPUTE, new ComputeMicroVersion(microVersion));
}

@Override
protected String getApiVersionHeader() {
return "OpenStack-API-Version";
}

private static class ComputeMicroVersion extends MicroVersion {

ComputeMicroVersion(MicroVersion microVersion) {
super(microVersion.toString());
}

@Override
public String toString() {
return "compute " + super.toString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
import org.openstack4j.openstack.compute.domain.NovaServerGroup;
import org.openstack4j.openstack.compute.domain.NovaServerGroup.ServerGroups;

public class ServerGroupServiceImpl extends BaseComputeServices implements ServerGroupService {
public class ServerGroupServiceImpl extends BaseMicroVersionedComputeServices implements ServerGroupService {

public ServerGroupServiceImpl() {
super(MICRO_VERSION_2_15);
}

@Override
public List<? extends ServerGroup> list() {
Expand Down